Skip to content

Commit 594f9b9

Browse files
committed
feat: 添加cssnano,打包时压缩css体积
1 parent 392105e commit 594f9b9

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
"@vue/runtime-core": "^3.2.38",
118118
"autoprefixer": "^10.4.8",
119119
"cloc": "^2.10.0",
120+
"cssnano": "^5.1.13",
120121
"eslint": "^8.8.0",
121122
"eslint-plugin-prettier": "^4.0.0",
122123
"eslint-plugin-vue": "^8.4.1",

pnpm-lock.yaml

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

postcss.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ module.exports = {
22
plugins: {
33
"postcss-import": {},
44
tailwindcss: {},
5-
autoprefixer: {}
5+
autoprefixer: {},
6+
...(process.env.NODE_ENV === "production" ? { cssnano: {} } : {})
67
}
78
};

0 commit comments

Comments
 (0)