webpack-02-html插件及webpack-dev-server 发表于 2019-11-17 | 分类于 webpack | 本文总阅读量 次 html-webpack-plugin和webpack-dev-server基础配置 webpack-dev-server开发环境配置 1234567devServer: { // 开发服务器的配置 port: 3000, // 端口号 progress: true, // 显示进度条 contentBase: ('./dist'), // 设置启动目录 open: true, // 打开浏览器 compress : true, // 资源采用gzip压缩}, webpack配置插件1plugins:[] html-webpack-plugin打包html文件 123456789new HtmlWebpackPlugin({ template: './src/index.html', filename: 'index.html', minify: { removeAttributeQuotes: true, // 删除双引号 collapseWhitespace: true, // 压缩空行 }, hash: true, // 给生成的js文件,添加hash戳(比如:bundle.ab24e2bd.js?ab24e2bd1cf2c8ab6a33)})