webpack4 【开发】【生产】【优化】相关配置
自动化构建
(一)npm scripts
npm允许在package.json文件里面,使用scripts字段定义脚本命令
{
// ...
"scripts": {
"build": "node build.js"
}
}
命令行下使用npm run命令,就可以执行这段脚本。
$ npm run build
# 等同于执行
$ node build.js
$ npm run //查看所有脚本命令
之前项目弊端
网页加载速度慢,因为会发起很多的二次请求(html中引入css、j
原创
2021-09-30 16:25:28 ·
158 阅读 ·
0 评论