当我尝试在某个过程中构建项目时,它会挂起并出现错误
ERROR in multi vendor
Module not found: Error: Can't resolve 'angular2-google-maps' in 'path_to_project'
@ multi vendor
我也将这些作为警告。我不明白究竟是什么问题以及我需要注意的地方。
WARNING in ./~/chokidar/lib/fsevents-handler.js
Module not found: Error: Can't resolve 'fsevents' in 'page_to_project\node_modules\chokidar\lib'
@ ./~/chokidar/lib/fsevents-handler.js 7:17-36
@ ./~/chokidar/index.js
@ ./~/watchpack/lib/DirectoryWatcher.js
@ ./~/watchpack/lib/watcherManager.js
@ ./~/watchpack/lib/watchpack.js
@ (webpack)/lib/node/NodeWatchFileSystem.js
@ (webpack)/lib/node ^\.\/.*$
@ (webpack)/lib/node/NodeMainTemplate.runtime.js
@ (webpack)/lib/node/NodeMainTemplatePlugin.js
@ (webpack)/lib/node/NodeTemplatePlugin.js
@ ./~/extract-text-webpack-plugin/loader.js
@ ./~/extract-text-webpack-plugin/index.js
@ multi vendor
WARNING in ./~/express/lib/view.js
78:29 Critical dependency: the request of a dependency is an expression
WARNING in ./~/bin-wrapper/index.js
5:34 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
解决webpack.dist.conf中的部分看起来像这样
resolve: {
modulesDirectories: [
'scripts',
'node_modules'
],
packageMains: ['angular2-google-maps'],
externals: {
"window":"window"
},
extensions: [
'',
'.webpack.js',
'.web.js',
'.js',
'.jsx',
'.ts'
]
},