Webpack依赖的请求是一个表达式

时间:2017-08-22 22:15:33

标签: node.js webpack

我在项目中使用drivelist模块和bindings依赖项。在使用webpack构建它之后,我收到以下警告:

  警告在./node_modules/bindings/bindings.js 81:22-40严重   依赖:依赖的请求是表达式

     警告在./node_modules/bindings/bindings.js 81:43-53严重   依赖:依赖的请求是表达式

然后在项目中,如果我这样做:

const bindings = require('bindings');
bindings('drivelist').list(callback);

我收到错误消息,我们无法找到drivelist.node

  

错误:找不到绑定文件。试过:→   Z:\ Jscode \ myapp \ build \ myapp \ win64 \ build \ drivelist.node→   Z:\ Jscode \ myapp \ build \ myapp \ win64 \ build \ Debug \ drivelist.node→   Z:\ Jscode \ myapp \ build \ myapp \ win64 \ build \ Release \ drivelist.node→   Z:\ Jscode \ myapp \ build \ myapp \ win64 \ out \ Debug \ drivelist.node→   Z:\ Jscode \ myapp \ build \ myapp \ win64 \ Debug \ drivelist.node→   Z:\ Jscode \ myapp \ build \ myapp \ win64 \ out \ Release \ drivelist.node→   Z:\ Jscode \ myapp \ build \ myapp \ win64 \ Release \ drivelist.node→   Z:\ Jscode \ myapp \ build \ myapp \ win64 \ build \ default \ drivelist.node→   Z:\ Jscode \ MYAPP \构建\ MyApp的\ Win64的\编译\ 8.1.4 \ WIN32 \ 64 \ drivelist.node

我的webpack配置很简单:

const config = {
    entry: [
        './app/index.js'
    ],
    output: {
        path: path.resolve(__dirname, 'app'),
        filename: 'bundle.js'
    },
    devtool: "source-map",
    target: 'node-webkit',
    node: {
        os: true,
        fs: true,
        child_process: true,
        __dirname: true,
        __filename: true,
        drivelist: true
    },
    plugins: []
};

0 个答案:

没有答案