Webpack Getting Started Tutorial XV

Source: Internet
Author: User

81. In the Webpack.config.js file configurationThe collapsewhitespace entry, which is used to remove whitespace characters and line breaks, is modified as follows
var webpack = require (' Webpack '), var htmlwebpackplugin = require (' Html-webpack-plugin '); module.exports = {entry: __ DirName + "/app/greeter.js", Output: {path: __dirname + "/build", FileName: "Bundle.js"},devserver:{contentbase: "./ Public ", Historyapifallback:true,inline:true},module:{loaders:[{test:/\.json$/,loader:" Json-loader "},{test:/\. Js$/,exclude:/node_modules/,loader: ' Babel-loader '},{test:/\.css$/,loader: ' Style-loader!css-loader?modules '}], Plugins:[new Webpack. Bannerplugin ("Copyright Suyan"), new Htmlwebpackplugin ({template:__dirname + "/app/index.tmpl.html", Title: ' Htmlwebpackplugin filename Test ', filename: ' filename.html ', inject:true,hash:true,minify:{removecomments:true, Collapsewhitespace:true}})]}
82. RePack with the Webpack command

650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M02/8D/C2/wKioL1iqgEKQxNJYAABWH8nIr4E289.png-wh_500x0-wm_ 3-wmp_4-s_2088585616.png "title=" 82.png "alt=" Wkiol1iqgekqxnjyaabwh8nir4e289.png-wh_50 "/>

83. View the generated filename.html page and generate the following

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M00/8D/C5/wKiom1iqgHqCfYRBAABi66SpfBk126.png-wh_500x0-wm_ 3-wmp_4-s_1920797452.png "title=" 83.png "alt=" Wkiom1iqghqcfyrbaabi66spfbk126.png-wh_50 "/>

Description
Generated filename.html file hollow lattice and line break has been cleared


This article is from the "Yan" blog, please be sure to keep this source http://suyanzhu.blog.51cto.com/8050189/1899437

Webpack Getting Started Tutorial XV

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.