Webpack Getting Started Tutorial 29

Source: Internet
Author: User

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 command

650) 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 file

650) 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.