webpack.config.js中不同頁面引入不同chunks卻沒有在html中引入相應的js腳本
a,b,c三個html分別引入的chunks如下:chunks: ['main','a'] ? ? ? chunks: ['main','b'] ? ? chunks: ['c'],a中引入了main.js和a.js,b中引入了main.js,而c中卻沒有引入任何js腳本 ,求解?
a,b,c三個html分別引入的chunks如下:chunks: ['main','a'] ? ? ? chunks: ['main','b'] ? ? chunks: ['c'],a中引入了main.js和a.js,b中引入了main.js,而c中卻沒有引入任何js腳本 ,求解?
2017-06-06
舉報
2017-09-01
plugins: [
? ? ? ? /*new webpack.ResolverPlugin([
? ? ? ? ? ? new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin("bower.json", ["main"])
? ? ? ? ], ["normal", "loader"])*/
? ? ? ? new htmlWebpackPlugin({
? ? ? ? template:'index.html',
? ? ? ? filename:'a.html',
? ? ? ? inject:'body',
? ? ? ? title:'a.html',
? ? ? ? chunks:['main','a']
? ? ? ? }),
? ? ? ? new htmlWebpackPlugin({
? ? ? ? ? ? template:'index.html',
? ? ? ? ? ? filename:'b.html',
? ? ? ? ? ? inject:'body',
? ? ? ? ? ? title:'b.html',
? ? ? ? ? ? chunks:['b']
? ? ? ? }),new htmlWebpackPlugin({
? ? ? ? ? ? template:'index.html',
? ? ? ? ? ? filename:'c.html',
? ? ? ? ? ? inject:'body',
? ? ? ? ? ? title:'c.html',
? ? ? ? ? ? chunks:['c']
? ? ? ? })
構(gòu)建后只有b.html和c.html沒有任何監(jiān)本引入
2017-06-06
代碼發(fā)上來看看