Browse Source

feat: 添加`cssnano`,打包时压缩`css`体积

i18n
xiaoxian521 2 years ago
parent
commit
d48058c28f
  1. 1
      package.json
  2. 2
      pnpm-lock.yaml
  3. 3
      postcss.config.js

1
package.json

@ -88,6 +88,7 @@
"@vue/runtime-core": "^3.2.38", "@vue/runtime-core": "^3.2.38",
"autoprefixer": "^10.4.8", "autoprefixer": "^10.4.8",
"cloc": "^2.10.0", "cloc": "^2.10.0",
"cssnano": "^5.1.13",
"eslint": "^8.8.0", "eslint": "^8.8.0",
"eslint-plugin-prettier": "^4.0.0", "eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^8.4.1", "eslint-plugin-vue": "^8.4.1",

2
pnpm-lock.yaml

@ -37,6 +37,7 @@ specifiers:
autoprefixer: ^10.4.8 autoprefixer: ^10.4.8
axios: ^0.27.2 axios: ^0.27.2
cloc: ^2.10.0 cloc: ^2.10.0
cssnano: ^5.1.13
dayjs: ^1.11.4 dayjs: ^1.11.4
echarts: ^5.3.3 echarts: ^5.3.3
element-plus: ^2.2.16 element-plus: ^2.2.16
@ -154,6 +155,7 @@ devDependencies:
"@vue/runtime-core": 3.2.38 "@vue/runtime-core": 3.2.38
autoprefixer: 10.4.8_postcss@8.4.16 autoprefixer: 10.4.8_postcss@8.4.16
cloc: 2.10.0 cloc: 2.10.0
cssnano: 5.1.13_postcss@8.4.16
eslint: 8.23.0 eslint: 8.23.0
eslint-plugin-prettier: 4.2.1_eslint@8.23.0+prettier@2.7.1 eslint-plugin-prettier: 4.2.1_eslint@8.23.0+prettier@2.7.1
eslint-plugin-vue: 8.7.1_eslint@8.23.0 eslint-plugin-vue: 8.7.1_eslint@8.23.0

3
postcss.config.js

@ -2,6 +2,7 @@ module.exports = {
plugins: { plugins: {
"postcss-import": {}, "postcss-import": {},
tailwindcss: {}, tailwindcss: {},
autoprefixer: {}
autoprefixer: {},
...(process.env.NODE_ENV === "production" ? { cssnano: {} } : {})
} }
}; };
Loading…
Cancel
Save