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
I came across this error when there is a spelling mistake the config details.
output: {
path: "app/dist/assets",
filname: "bundle.js",
publicPath: "assets"
},
mispelled "filename". on correcting the spelling, this issue is resolved
You MUST have a file named webpack.config.js
on project root.
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
If you using __dirname
make sure it referenced to correct path. Default path is /
which is local drive root.
I was getting the same error and it turned out to be my webpack config file name.
I had it as "webpack.config
" instead of "webpack.config.js
"
The "Output filename not configured" error seems to come up generally when there is a typo somewhere, and I've found the file name to be a sneaky place you forget to check.