摘要: 1.配置 1.插件安装 npm install webpack-merge@4.0.0 --save-dev 2.build新建文件夹 将webpack.config.js代码CV进这三个文件并作删减,最后删除webpack.config.js文件 (1)base.config.js 因为base引 阅读全文
posted @ 2021-06-21 15:22 ajaXJson 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 1.安装插件 npm install webpack-dev-server@2.9.3 --save-dev 2.webpackconfig.js新增 devServer:{ contentBase:'./dist', //为哪一个文件夹提供本地服务,默认根文件夹,这里填写./dist inline 阅读全文
posted @ 2021-06-21 14:27 ajaXJson 阅读(52) 评论(0) 推荐(0) 编辑
摘要: 1.安装插件 npm install uglifyjs-webpack-plugin@1.1.1 --save-dev 2.配置 webpack.config.js中导入 const UglifyWebpackPlugin = require('uglifyjs-webpack-plugin') p 阅读全文
posted @ 2021-06-21 13:55 ajaXJson 阅读(57) 评论(0) 推荐(0) 编辑
摘要: 1.webpack.config.js中导入 const HtmlWebpackPlugin = require('html-webpack-plugin') 2.pulgin中新增 new HtmlWebpackPlugin({ template:'index.html' }) 3.需要删除out 阅读全文
posted @ 2021-06-21 13:46 ajaXJson 阅读(85) 评论(0) 推荐(0) 编辑
摘要: 1.webpack.config.js中新增 const webpack = require('webpack') //新增 2.module.exports中新增 plugins:[ new webpack.BannerPlugin('最终版权归你爹我所有') ] 3.运行 npm run bui 阅读全文
posted @ 2021-06-21 11:19 ajaXJson 阅读(23) 评论(0) 推荐(0) 编辑