WEBPACK 4 SplitChunks插件未拆分

时间:2018-08-09 11:33:19

标签: webpack webpack-4

我设置了

```

import numpy as np
import matplotlib.pylab as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable

Filename='DS_MNASP_12_RT-483K_'  
FileExtension= '.dat' 
FileNumberBegin =1 
FileNumberEnd =10 
theta_min=1
theta_max=10
RT = 290 
HT=523 


Filenames = []
    for i  in range(FileNumberBegin,FileNumberEnd + 1):
    Filenames.append(Filename + (4-len(str(i)))*'0' + str(i) + 'p' + 
                 FileExtension)

data=[]
for j in Filenames:
    data.append(np.genfromtxt(j, dtype='float', skip_header=41)) 
d=np.array(data)

ylabel = '$Temperature\/(k)$'
xlabel = '$2\/theta (degrees)$'



x = d[0,theta_min:theta_max,0] 
y = (np.arange(RT,HT+1, dtype='float64'))
z = d[:,theta_min:theta_max,1] 

X,Y = plt.meshgrid(x, y) 
Z = z 


xmin = theta_min
xmax = theta_max


im = plt.imshow(Z, origin='lower', aspect='auto', extent=[xmin, xmax, y[0], 
    y[-1]]) 

ax = plt.gca()
ax.set_autoscale_on(False)
ax.set_xlabel(xlabel, fontsize = 30)
ax.set_ylabel(ylabel, fontsize = 30)
ax.tick_params(labelsize=20, pad =7, direction='out', width=2, top='off', 
right='off')
plt.tight_layout()
plt.show()

```

但是,路径包含my-bundle1的文件的源未出现在my-bundle1.bundle.js中。而是它们出现在common.js中

PS:在webpack 3中,我曾经通过commonsChunkPlugins列表创建这些捆绑包: optimization:{ splitChunks: 'my-bundle1':{ chunks:"async", test: (module)=>{ return /my-bundle1/.test(module.resource) }, name:"my-bundle1", enforce:true, reuseExistingChunk:true }}

1 个答案:

答案 0 :(得分:0)

答案是提高优先级。一旦我添加了优先级:100,它就会起作用