webpack 合并的时候怎么不处理第三方js,例如jquery
1个回答
展开全部
用官方插件 webpack.IgnorePlugin 把不想 bundle 的文件排除掉就好。Example:
var webpack = require('webpack');
var ignoreFiles = new webpack.IgnorePlugin(/\.\/jquery-last.js$/);
module.exports = {
entry: './main',
output: {
path: __dirname,
filename: 'bundle.js'
},
plugins: [ignoreFiles]
}
var webpack = require('webpack');
var ignoreFiles = new webpack.IgnorePlugin(/\.\/jquery-last.js$/);
module.exports = {
entry: './main',
output: {
path: __dirname,
filename: 'bundle.js'
},
plugins: [ignoreFiles]
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询