我是webpack的新手,我实际上已经陷入了困境。我读了一些关于webpack的文章,所以开始尝试一个项目(只是在第三部分库)。我创建了我的入口点.js:
require('angular');
require('angular-bootstrap');
require('angular-file-upload');
require('angular-local-storage');
require('angular-ui-grid');
require('angular-ui-router');
require('ng-idle');
require('bootstrap');
require('jquery');
和webpack.config.js:
module.exports = {
entry : './entry-point.js',
output : {
path : __dirname + "/dist",
filename : 'vendor.js'
},
resolve : {
modules : [ 'bower_components' ]
}
};
但是当我启动' npm start'我收到以下错误:
找不到模块:错误:无法解决' jquery'在 ' d:\文件\ SVILUPPO \ Eclipse的\工作区\ SCARICO-TeamcenterEasyApp \目标\ TeamcenterEasyApp-0.0.1' 解决' jquery'在 ' d:\文件\ SVILUPPO \ Eclipse的\工作区\ SCARICO-TeamcenterEasyApp \目标\ TeamcenterEasyApp-0.0.1'
显然,该库存在于我的bower_components文件夹中。 注意:webpack 2.2.1版
这是我的package.json:
{
"name": "TeamcenterEasyApp-0.0.1",
"version": "1.0.0",
"description": "",
"main": "entry-point.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "webpack"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"webpack": "^3.8.1"
}
}