From 594f9b98abe71b1a452088c4fee009efd737ca25 Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Thu, 8 Sep 2022 17:23:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0`cssnano`=EF=BC=8C?= =?UTF-8?q?=E6=89=93=E5=8C=85=E6=97=B6=E5=8E=8B=E7=BC=A9`css`=E4=BD=93?= =?UTF-8?q?=E7=A7=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + pnpm-lock.yaml | 2 ++ postcss.config.js | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index b686f32b9..03d1d13fe 100644 --- a/package.json +++ b/package.json @@ -117,6 +117,7 @@ "@vue/runtime-core": "^3.2.38", "autoprefixer": "^10.4.8", "cloc": "^2.10.0", + "cssnano": "^5.1.13", "eslint": "^8.8.0", "eslint-plugin-prettier": "^4.0.0", "eslint-plugin-vue": "^8.4.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c0bdd8dd2..f73dd2c72 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -52,6 +52,7 @@ specifiers: china-area-data: ^5.0.1 cloc: ^2.10.0 cropperjs: ^1.5.12 + cssnano: ^5.1.13 dayjs: ^1.11.4 driver.js: ^0.9.8 echarts: ^5.3.3 @@ -212,6 +213,7 @@ devDependencies: '@vue/runtime-core': 3.2.38 autoprefixer: 10.4.8_postcss@8.4.16 cloc: 2.10.0 + cssnano: 5.1.13_postcss@8.4.16 eslint: 8.23.0 eslint-plugin-prettier: 4.2.1_eslint@8.23.0+prettier@2.7.1 eslint-plugin-vue: 8.7.1_eslint@8.23.0 diff --git a/postcss.config.js b/postcss.config.js index 854240c37..20d42d838 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -2,6 +2,7 @@ module.exports = { plugins: { "postcss-import": {}, tailwindcss: {}, - autoprefixer: {} + autoprefixer: {}, + ...(process.env.NODE_ENV === "production" ? { cssnano: {} } : {}) } };