Output filename not configured Error in Webpack

前端 未结 17 2022
执笔经年
执笔经年 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:30

    I ran into this problem after following Webpacks docs for production builds. The way I ran into the issue is, I believe, specific to webpack-merge.

    This is what their docs have in webpack.dev.js:

    const merge = require('webpack-merge');
    const common = require('./webpack.common.js');
    
    module.exports = merge(common, {
      devtool: 'inline-source-map',
      devServer: {
        contentBase: './dist'
      }
    });
    

    But this is what I needed to have:

    const merge = require('webpack-merge');
    const common = require('./webpack.common.js');
    
    module.exports = merge(common(), {
      devtool: 'inline-source-map',
      devServer: {
        contentBase: './dist'
      }
    });
    

    Notice the only change is running common() instead of common.

提交回复
热议问题