2022年5月2日
摘要: const { resolve } = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); module.exports = { entry: ['./src/js/index.js', './src/ 阅读全文
posted @ 2022-05-02 18:13 weakup 阅读(106) 评论(0) 推荐(0) 编辑
摘要: /* HMR: hot module replacement 热模块替换 / 模块热替换 作用:一个模块发生变化,只会重新打包这一个模块(而不是打包所有模块) 极大提升构建速度 样式文件:可以使用HMR功能:因为style-loader内部实现了~ js文件:默认不能使用HMR功能 --> 需要修改 阅读全文
posted @ 2022-05-02 17:12 weakup 阅读(28) 评论(0) 推荐(0) 编辑
摘要: const { resolve } = require('path'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const OptimizeCssAssetsWebpackPlugin = require(' 阅读全文
posted @ 2022-05-02 16:50 weakup 阅读(68) 评论(0) 推荐(0) 编辑
摘要: const { resolve } = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); module.exports = { entry: './src/js/index.js', output: 阅读全文
posted @ 2022-05-02 16:32 weakup 阅读(82) 评论(0) 推荐(0) 编辑
摘要: const { resolve } = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); module.exports = { entry: './src/js/index.js', output: 阅读全文
posted @ 2022-05-02 16:25 weakup 阅读(46) 评论(0) 推荐(0) 编辑
摘要: const { resolve } = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); module.exports = { entry: './src/js/index.js', output: 阅读全文
posted @ 2022-05-02 15:50 weakup 阅读(104) 评论(0) 推荐(0) 编辑
摘要: const { resolve } = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const MiniCssExtractPlugin = require('mini-css-extract- 阅读全文
posted @ 2022-05-02 15:30 weakup 阅读(28) 评论(0) 推荐(0) 编辑
摘要: const { resolve } = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const MiniCssExtractPlugin = require('mini-css-extract- 阅读全文
posted @ 2022-05-02 15:26 weakup 阅读(31) 评论(0) 推荐(0) 编辑
摘要: const { resolve } = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const MiniCssExtractPlugin = require('mini-css-extract- 阅读全文
posted @ 2022-05-02 15:12 weakup 阅读(84) 评论(0) 推荐(0) 编辑
摘要: /* 开发环境配置:能让代码运行 运行项目指令: webpack 会将打包结果输出出去 npx webpack-dev-server 只会在内存中编译打包,没有输出 */ const { resolve } = require('path'); const HtmlWebpackPlugin = r 阅读全文
posted @ 2022-05-02 14:14 weakup 阅读(61) 评论(0) 推荐(0) 编辑
摘要: const { resolve } = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); module.exports = { entry: './src/index.js', output: { f 阅读全文
posted @ 2022-05-02 13:59 weakup 阅读(77) 评论(0) 推荐(0) 编辑
摘要: const { resolve } = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); module.exports = { entry: './src/index.js', output: { f 阅读全文
posted @ 2022-05-02 11:48 weakup 阅读(29) 评论(0) 推荐(0) 编辑
摘要: /* loader: 1. 下载 2. 使用(配置loader) plugins: 1. 下载 2. 引入 3. 使用 */ const { resolve } = require('path'); const HtmlWebpackPlugin = require('html-webpack-pl 阅读全文
posted @ 2022-05-02 11:26 weakup 阅读(54) 评论(0) 推荐(0) 编辑
摘要: /* webpack.config.js webpack的配置文件 作用: 指示 webpack 干哪些活(当你运行 webpack 指令时,会加载里面的配置) 所有构建工具都是基于nodejs平台运行的~模块化默认采用commonjs。 */ // resolve用来拼接绝对路径的方法 const 阅读全文
posted @ 2022-05-02 10:55 weakup 阅读(39) 评论(0) 推荐(0) 编辑