133. Refer to the script script inline in the template, modify the Webpack.config.js file, and the code is as follows
var htmlwebpackplugin = require ("Html-webpack-plugin"); module.exports = {entry:{main: './src/script/main.js ', A: './ Src/script/a.js '},output:{path: './dist ', filename: ' Js/[name]-[hash].js ', Publicpath: ' http://cdn.com/'},plugins:[ New Htmlwebpackplugin ({Template: ' index.html ', filename: ' a.html ', Inject:false,title: ' This is a.html '}), new Htmlwebpackplugin ({Template: ' index.html ', filename: ' b.html ', Inject:false,title: ' This is b.html '}), new Htmlwebpackplugin ({Template: ' index.html ', filename: ' c.html ', Inject:false,title: ' This is c.html '})]}
134. Modify the template file index.html, the code is as follows
<! DOCTYPE html>
650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M02/8D/CB/wKiom1iq0EHCDlz5AACVwJUCSk8259.png-wh_500x0-wm_ 3-wmp_4-s_3167873831.png "title=" Qq20170220191644.png "alt=" Wkiom1iq0ehcdlz5aacvwjucsk8259.png-wh_50 "/>
135. RePack with the CNPM run Webpack command650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M00/8D/CB/wKiom1iq0FnhB45MAACRHgDdS-M846.png-wh_500x0-wm_ 3-wmp_4-s_3992230382.png "title=" Qq20170220191708.png "alt=" Wkiom1iq0fnhb45maacrhgdds-m846.png-wh_50 "/>
136. View the generated a.html,b.html,c.html file650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M02/8D/C9/wKioL1iq0IeypVKsAAD_Eaz3ANY617.png-wh_500x0-wm_ 3-wmp_4-s_4175582340.png "title=" Qq20170220191755.png "alt=" Wkiol1iq0ieypvksaad_eaz3any617.png-wh_50 "/>
650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M00/8D/C9/wKioL1iq0NDzWi65AAD6coNBti0285.png-wh_500x0-wm_ 3-wmp_4-s_2425577470.png "title=" Qq20170220191905.png "alt=" Wkiol1iq0ndzwi65aad6conbti0285.png-wh_50 "/>
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/8D/CB/wKiom1iq0K6Si3RjAAD9ep4Qquo737.png-wh_500x0-wm_ 3-wmp_4-s_307981564.png "title=" Qq20170220191833.png "alt=" Wkiom1iq0k6si3rjaad9ep4qquo737.png-wh_50 "/>
Webpack Getting Started Tutorial 29