Sean Sean - 4 months ago 29
AngularJS Question

Webpack ERROR in missing path

I am getting an error whenever I try to run Webpack. It just says ERROR in missing path. The error goes away when I remove the module key in the configuration below:

module.exports = {
entry: './client/scripts/app.js',
output: {
path: './docs/scripts/',
filename: 'bundle.js'
},
module: {
loaders: [{
test: /\.js$/,
loader: 'ng-annotate!',
exclude: /node_modules|docs\/bower_components/
}],
}
};


Here is the error output:

Hash: 396f0bfb9d565b6f60f0
Version: webpack 1.13.1
Time: 76ms
+ 1 hidden modules

ERROR in missing path


My webpack config sits in the root of my project. The folder structure is below:

client
scripts
app.js
node_modules
docs
scripts
bundle.js
bower_components
webpack.config.js

Answer

I think you have mistake in RegExp, add \ before /

/node_modules|docs\/bower_components/  
                  ^^

also in loader you do not need add ! after ng-annotate, because you are using only one loader