上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 61 下一页
摘要: // 合并开发 环境 配置区分打包 npm install webpack-merge@4.1.5 -D package.json "scripts": { "dev": "webpack-dev-server --config ./build/webpack.dev.js", "build": " 阅读全文
posted @ 2021-11-26 10:15 13522679763-任国强 阅读(45) 评论(0) 推荐(0)
摘要: 配置 tree shaking plugins:[ ], // 增加这个 (开发环境下 增加, 线上环境不用增加) // optimization:{ // usedExports: true // }, devServer:{ } package.json "name": "webpack4", 阅读全文
posted @ 2021-11-26 09:36 13522679763-任国强 阅读(149) 评论(0) 推荐(0)
摘要: // 配置 babel es6 语法转成 es5 npm install --save-dev babel-loader @babel/core npm install @babel/preset-env --save-dev npm install --save @babel/polyfill n 阅读全文
posted @ 2021-11-25 17:40 13522679763-任国强 阅读(130) 评论(0) 推荐(0)
摘要: // 配置 source-map 快速定位js代码错误位置 // 开发配置 // mode:'development', // development || production // source-map->会生成单独的 .map 文件 // inline-source-map 不会生成单独的 . 阅读全文
posted @ 2021-11-25 14:50 13522679763-任国强 阅读(300) 评论(0) 推荐(0)
摘要: // 配置 entry 和 output entry:{ main:'./src/index.js', // sub:'./src/index.js' }, output:{ // filename: 'dist.js', // publicPath:'http:///www.cdn.com', / 阅读全文
posted @ 2021-11-25 13:53 13522679763-任国强 阅读(38) 评论(0) 推荐(0)
摘要: // 自动生成 html 文件 npm install html-webpack-plugin@3.2.0 -D const htmlWebpackPligun = require('html-webpack-plugin') plugins:[ new htmlWebpackPligun({ te 阅读全文
posted @ 2021-11-25 12:23 13522679763-任国强 阅读(87) 评论(0) 推荐(0)
摘要: // 打包字体文件 { test:/\.(woff2|woff|ttf)$/, use:{ loader:'file-loader' } } , 阅读全文
posted @ 2021-11-25 11:47 13522679763-任国强 阅读(52) 评论(0) 推荐(0)
摘要: // { // test:/\.css$/, // use:['style-loader','css-loader'] // } , { test:/\.scss$/, use:[ 'style-loader', // 'css-loader', { loader:'css-loader', opt 阅读全文
posted @ 2021-11-25 11:29 13522679763-任国强 阅读(27) 评论(0) 推荐(0)
摘要: // 打包文件图片url-loader // url-loader 可以配置是否生成 base64 格式图片 npm install url-loader -D rules:[ { test:/\.(jpg|png|gif)$/, use:{ loader: 'url-loader', option 阅读全文
posted @ 2021-11-25 10:03 13522679763-任国强 阅读(39) 评论(0) 推荐(0)
摘要: // 复制文本 function copyText(text){ // 数字没有 .length 不能执行selectText 需要转化成字符串 const textString = text.toString(); let input = document.querySelector('#copy 阅读全文
posted @ 2021-11-16 09:36 13522679763-任国强 阅读(37) 评论(0) 推荐(0)
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 61 下一页