Webpack v4 - optimization.splitChunk名称不正确

时间:2018-05-17 12:04:25

标签: webpack

我正在将webpack从v3迁移到v4,并且遇到了一些新的require(igraph) e <- c(1,2, 2,3, 3,1, 3,4 , 4,1 , 2,1) g <- graph(e, n=5, directed = TRUE) curve.reciprocal.edges <- function(g, curve=.3){ # Return a graph where the edge-attribute $curved is reset to highlight reciprocal edges el <- t(apply(get.edgelist(g),1,sort)) E(g)$curved <- 0 E(g)[duplicated(el) | duplicated(el,fromLast =TRUE)]$curved <- curve (g) } plot(g, layout=layout.circle, edge.curved=.2) plot(curve.reciprocal.edges(g), layout=layout.circle) 格式问题。

目前,当CommonsChunkPlugin设置为mode时,一切正常,输出:

developmentvendor.jsshared.jsdefault.js0.js等等。

但是,当1.js设置为mode时,productionshared.js捆绑包会以数字命名,这意味着我无法再在页面中包含它们。这些块通常用于遵循vendor.jsfilename的{​​{1}}属性,因为哈希是由于架构原因而由另一步提供的。

我的配置如下:

output

由于

1 个答案:

答案 0 :(得分:0)

使用此插件找到解决方案: https://www.npmjs.com/package/webpack-chunk-rename-plugin

为我的案例 configData = []byte(`api: telegram_token: "telegramtoken" waves_token: "wavestoken"`) ) shared.js提供某些块的单独命名规则:

vendor.js