2016-07-26 45 views
1

每当我尝试运行Webpack时,都会收到错误消息。它只是说错误路径中的错误。该错误消失时,我卸下模块重点在以下配置:缺少路径的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 

回答

1

你有错误的RegExp,前/

/node_modules|docs\/bower_components/ 
        ^^ 

还添加\ng-annotate后,你不需要添加!,因为你只使用一个装载机

loader: 'ng-annotate' 
        ^^ 
+1

修正了它。谢谢。 – Sean