Output filename not configured Error in Webpack

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

    Common mistakes of this error is typo and most of the times it's writing module.export instead of module.exports. Also check the file name should be with a .js extension. e.g. webpack.config.js

    0 讨论(0)
  • 2021-01-07 18:14

    Assuming that you would be using windows. i ran out into same error and realized i have to do something like this in wiindows d:\unpack-webpack> d:\unpack-webpack\node_modules.bin\webpack

    instead i was doing d:\unpack-webpack\node_modules.bin\webpack

    Hope this helps :) Thanks Gaurav Khurana

    0 讨论(0)
  • 2021-01-07 18:18

    also after checking the right file name which should be 'webpack.config.js', a good note is to check where the 'webpack.config.js' file is located. it should be in the same folder as your package.json file is located

    0 讨论(0)
  • 2021-01-07 18:22

    You have a typo somewhere in your webpack.config.js file. Review your config file. Had similar problem and it was as a result of a typo.

    0 讨论(0)
  • 2021-01-07 18:24

    Also double-check that the webpack.config.js file is in the right spot (in general, the root directory of the project) and the paths listed in the config file are correct.

    0 讨论(0)
  • 2021-01-07 18:24

    Following are the things to check when you get this error.

    • Whether your executing webpack command in the directory where your webpack.config.js file resides.
    • You may be pointing to the wrong directory in your terminal.
    • Typo error with the file name "webpack.config.js".
    • No Module to export in your config file.
    • Check for typo error in your config file
    0 讨论(0)
提交回复
热议问题