1
我想从我的包中删除angular.js。无法找到一种方法将其从bundle.js中删除,因为Webpack以某种方式从我的入口文件中解析它。所以我决定使用webpack.IgnorePlugin
但结果我收到错误。使用IgnorePlugin的Webpack生成webpackMissingModule错误
不能webpackMissingModule
找到模块 “角” 我已经包括了来自CDN角JS bundle.js被加载之前。但它仍然试图从webpack脚本解决它。
webpack.make.js
module.exports = function makeWebpackConfig(options) {
var config = {};
config.entry = {
app: './app/app.js'
}
config.output = {
path: __dirname + '/public',
publicPath: BUILD ? '/' : 'http://localhost:8080/',
filename: 'bundle.js',
chunkFilename: 'bundle.js',
}
...
config.module = {
loaders: [{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
}, {
test: /\.html$/,
loader: 'raw'
}]
};
config.plugins = [
new webpack.IgnorePlugin(/angular$/),
];
...
return config;
};