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