Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
53
rated 0 times [  56] [ 3]  / answers: 1 / hits: 24357  / 7 Years ago, fri, june 23, 2017, 12:00:00

Webpack 2.2.0 is giving me this error when I try to run an npm script:




No configuration file found and no output filename configured via CLI option.




I've made sure that webpack.config.js is in the src folder.



module.exports = {
entry: './src/app.js',
output: {
filename: './dist/app.bundle.js'
}
}


enter



Here is my project structure.



I appreciate any assistance.


More From » webpack

 Answers
2

You have 2 solutions:




  • move webpack.config.js to the root folder instead of ./src (pointed out by Jared Farrish)

  • use the --config attribute with the CLI that points to ./src/webpack.config.js: webpack --config src/webpack.config.js


[#57336] Wednesday, June 21, 2017, 7 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
brennanm

Total Points: 510
Total Questions: 103
Total Answers: 95

Location: Nicaragua
Member since Tue, Dec 8, 2020
4 Years ago
brennanm questions
Thu, Jan 9, 20, 00:00, 5 Years ago
Thu, Sep 26, 19, 00:00, 5 Years ago
Thu, Aug 29, 19, 00:00, 5 Years ago
;