Output filename not configured Error in Webpack

前端 未结 17 1866
执笔经年
执笔经年 2021-01-07 18:08

I had installed it globally by running npm install webpack -g and I had included it in my project by running npm install webpack --save-dev.

However, on running the

17条回答
  •  失恋的感觉
    2021-01-07 18:37

    Try exporting your configuration using module.exports = config where config is your configuration in a JavaScript object. In your case just do

    module.exports = {
      output: {
        filename: 'bundle.js',
        library: 'require',
        libraryTarget: 'this'
      }
    }
    

    If this does not solve your problems, refer to the issue on https://github.com/webpack/webpack/issues/2403

提交回复
热议问题