Le contenu de cet article explique comment empaqueter des fichiers HTML ? L'introduction à la méthode d'empaquetage des fichiers HTML a une certaine valeur de référence. Les amis dans le besoin peuvent s'y référer, j'espère qu'elle vous sera utile.
plugins:[ new htmlPlugin({ minify:{ removeAttributeQuotes:true //对html进行压缩,去掉属性的双引号 }, hash:true, //为了开发中js有缓存效果,加入hash可以有效避免缓存JS template:'./src/index.html' //是要打包的html模板路径和文件名称 }) ]
i 「wds」: Project is running at http://10.212.109.18:8087/ i 「wds」: webpack output is served from / i 「wds」: Content not from webpack is served from F:\webLearn\webpackLearn\dist ‼ 「wdm」: Hash: 027dd749b565ba3b200d Version: webpack 4.15.1 Time: 3008ms Built at: 2018-07-11 08:49:13 Asset Size Chunks Chunk Names entry2.js 139 KiB 0 [emitted] entry2 entry.js 145 KiB 1 [emitted] entry index.html 427 bytes [emitted] Entrypoint entry = entry.js Entrypoint entry2 = entry2.js
Hash: 40112e2b8d4dc81b512b Version: webpack 4.15.1 Time: 5299ms Built at: 2018-07-11 08:47:26 Asset Size Chunks Chunk Names entry2.js 962 bytes 0 [emitted] entry2 entry.js 6.75 KiB 1 [emitted] entry index.html 427 bytes [emitted] [0] ./src/entry2.js 33 bytes {0} [built] [4] ./node_modules/css-loader!./src/css/index.css 227 bytes {1} [built] [5] ./src/css/index.css 1.06 KiB {1} [built] [6] ./src/entry.js 94 bytes {1} [built] + 3 hidden modules WARNING in configuration The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment. You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/ Child html-webpack-plugin for "index.html": 1 asset [0] (webpack)/buildin/module.js 497 bytes {0} [built] [1] (webpack)/buildin/global.js 489 bytes {0} [built] [3] ./node_modules/html-webpack-plugin/lib/loader.js!./src/index.html 511 bytes {0} [built] + 1 hidden module
Ce qui précède est le contenu détaillé de. pour plus d'informations, suivez d'autres articles connexes sur le site Web de PHP en chinois!