每当我尝试运行Webpack时,都会收到错误消息。它只是显示缺少路径的错误。当我在下面的配置中删除模块密钥时,错误消失了:
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/
}],
}
}; 以下是错误输出:
Hash: 396f0bfb9d565b6f60f0
Version: webpack 1.13.1
Time: 76ms
+ 1 hidden modules
ERROR in missing path我的webpack配置位于我项目的根目录中。文件夹结构如下:
client
scripts
app.js
node_modules
docs
scripts
bundle.js
bower_components
webpack.config.js发布于 2016-07-26 23:41:16
您在RegExp中有错误,在/之前添加\
/node_modules|docs\/bower_components/
^^在ng-annotate之后,您也不需要添加!,因为您只使用了一个加载器
loader: 'ng-annotate'
^^ https://stackoverflow.com/questions/38594312
复制相似问题