我目前的webpack-3配置是从许多angular-1模块创建bundle.js。
load.js通过require.js加载bundle.js?1234,我需要在每次重建时更改URL查询参数(防止缓存)。
我尝试了string-replace-loader,但它不能直接进行配置。因为load.js不在入口文件列表中。
那么如何处理文件而不将其包含在包中呢?
module.exports = {
context: "/app",
entry: ['source1.js', 'source2.js', 'source3.js'],
output: {
path: "/dist",
filename: "bundle.js"
},
plugins: [ new BabiliPlugin() ],
module: {
loaders: [
{
test: /load\.js$/,
loader: 'string-replace-loader',
query: {
search: 'bundle.js', // simple test, check it actually run
replace: '-replaced-'
}
}
]}};发布于 2017-07-19 18:39:50
你只需要做:
filename: "[name].[hash].bundle.js"https://stackoverflow.com/questions/45188059
复制相似问题