From 692e0cf2c9a268467419ce57f50411fe89bc4e05 Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Thu, 6 Jul 2023 13:08:09 +0100 Subject: [PATCH] Use lightning css for minifying css. --- package.json | 1 + pnpm-lock.yaml | 112 +++++++++++++++++++++++++++++++++++++++++++++---- vite.config.js | 1 + 3 files changed, 107 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index dc2ef502..efb3a0b1 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "eslint-config-prettier": "8.8.0", "eslint-plugin-prettier": "4.2.1", "eslint-plugin-vue": "9.15.1", + "lightningcss": "1.21.5", "prettier": "2.8.8", "unocss": "0.53.4", "vite": "4.4.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 70cd21f0..d72754bc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -97,6 +97,9 @@ devDependencies: eslint-plugin-vue: specifier: 9.15.1 version: 9.15.1(eslint@8.44.0) + lightningcss: + specifier: 1.21.5 + version: 1.21.5 prettier: specifier: 2.8.8 version: 2.8.8 @@ -105,7 +108,7 @@ devDependencies: version: 0.53.4(postcss@8.4.24)(rollup@2.79.1)(vite@4.4.0) vite: specifier: 4.4.0 - version: 4.4.0(terser@5.18.2) + version: 4.4.0(lightningcss@1.21.5)(terser@5.18.2) vite-plugin-eslint: specifier: 1.8.1 version: 1.8.1(eslint@8.44.0)(vite@4.4.0) @@ -2196,7 +2199,7 @@ packages: chokidar: 3.5.3 fast-glob: 3.3.0 magic-string: 0.30.0 - vite: 4.4.0(terser@5.18.2) + vite: 4.4.0(lightningcss@1.21.5)(terser@5.18.2) transitivePeerDependencies: - rollup dev: true @@ -2216,7 +2219,7 @@ packages: regenerator-runtime: 0.13.11 systemjs: 6.14.1 terser: 5.18.2 - vite: 4.4.0(terser@5.18.2) + vite: 4.4.0(lightningcss@1.21.5)(terser@5.18.2) transitivePeerDependencies: - supports-color dev: true @@ -2228,7 +2231,7 @@ packages: vite: ^4.0.0 vue: ^3.2.25 dependencies: - vite: 4.4.0(terser@5.18.2) + vite: 4.4.0(lightningcss@1.21.5)(terser@5.18.2) vue: 3.3.4 dev: true @@ -2685,6 +2688,12 @@ packages: resolution: {integrity: sha512-FJ9RDpf3GicEBvzI3jxc2XhHzbqD8p4ANw/1kPsFBfTvP1b7Gn/Lg1vO7R9J4IVgoMbyUmFrFGZafJ1hPZpvlg==} dev: true + /detect-libc@1.0.3: + resolution: {integrity: sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==} + engines: {node: '>=0.10'} + hasBin: true + dev: true + /doctrine@3.0.0: resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} engines: {node: '>=6.0.0'} @@ -3611,6 +3620,94 @@ packages: type-check: 0.4.0 dev: true + /lightningcss-darwin-arm64@1.21.5: + resolution: {integrity: sha512-z05hyLX85WY0UfhkFUOrWEFqD69lpVAmgl3aDzMKlIZJGygbhbegqb4PV8qfUrKKNBauut/qVNPKZglhTaDDxA==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /lightningcss-darwin-x64@1.21.5: + resolution: {integrity: sha512-MSJhmej/U9MrdPxDk7+FWhO8+UqVoZUHG4VvKT5RQ4RJtqtANTiWiI97LvoVNMtdMnHaKs1Pkji6wHUFxjJsHQ==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /lightningcss-linux-arm-gnueabihf@1.21.5: + resolution: {integrity: sha512-xN6+5/JsMrbZHL1lPl+MiNJ3Xza12ueBKPepiyDCFQzlhFRTj7D0LG+cfNTzPBTO8KcYQynLpl1iBB8LGp3Xtw==} + engines: {node: '>= 12.0.0'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /lightningcss-linux-arm64-gnu@1.21.5: + resolution: {integrity: sha512-KfzFNhC4XTbmG3ma/xcTs/IhCwieW89XALIusKmnV0N618ZDXEB0XjWOYQRCXeK9mfqPdbTBpurEHV/XZtkniQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /lightningcss-linux-arm64-musl@1.21.5: + resolution: {integrity: sha512-bc0GytQO5Mn9QM6szaZ+31fQHNdidgpM1sSCwzPItz8hg3wOvKl8039rU0veMJV3ZgC9z0ypNRceLrSHeRHmXw==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /lightningcss-linux-x64-gnu@1.21.5: + resolution: {integrity: sha512-JwMbgypPQgc2kW2av3OwzZ8cbrEuIiDiXPJdXRE6aVxu67yHauJawQLqJKTGUhiAhy6iLDG8Wg0a3/ziL+m+Kw==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /lightningcss-linux-x64-musl@1.21.5: + resolution: {integrity: sha512-Ib8b6IQ/OR/VrPU6YBgy4T3QnuHY7DUa95O+nz+cwrTkMSN6fuHcTcIaz4t8TJ6HI5pl3uxUOZjmtls2pyQWow==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /lightningcss-win32-x64-msvc@1.21.5: + resolution: {integrity: sha512-A8cSi8lUpBeVmoF+DqqW7cd0FemDbCuKr490IXdjyeI+KL8adpSKUs8tcqO0OXPh1EoDqK7JNkD/dELmd4Iz5g==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /lightningcss@1.21.5: + resolution: {integrity: sha512-/pEUPeih2EwIx9n4T82aOG6CInN83tl/mWlw6B5gWLf36UplQi1L+5p3FUHsdt4fXVfOkkh9KIaM3owoq7ss8A==} + engines: {node: '>= 12.0.0'} + dependencies: + detect-libc: 1.0.3 + optionalDependencies: + lightningcss-darwin-arm64: 1.21.5 + lightningcss-darwin-x64: 1.21.5 + lightningcss-linux-arm-gnueabihf: 1.21.5 + lightningcss-linux-arm64-gnu: 1.21.5 + lightningcss-linux-arm64-musl: 1.21.5 + lightningcss-linux-x64-gnu: 1.21.5 + lightningcss-linux-x64-musl: 1.21.5 + lightningcss-win32-x64-msvc: 1.21.5 + dev: true + /local-pkg@0.4.3: resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==} engines: {node: '>=14'} @@ -4511,7 +4608,7 @@ packages: '@types/eslint': 8.40.2 eslint: 8.44.0 rollup: 2.79.1 - vite: 4.4.0(terser@5.18.2) + vite: 4.4.0(lightningcss@1.21.5)(terser@5.18.2) dev: true /vite-plugin-pwa@0.16.4(vite@4.4.0)(workbox-build@7.0.0)(workbox-window@7.0.0): @@ -4525,14 +4622,14 @@ packages: debug: 4.3.4 fast-glob: 3.3.0 pretty-bytes: 6.1.0 - vite: 4.4.0(terser@5.18.2) + vite: 4.4.0(lightningcss@1.21.5)(terser@5.18.2) workbox-build: 7.0.0 workbox-window: 7.0.0 transitivePeerDependencies: - supports-color dev: true - /vite@4.4.0(terser@5.18.2): + /vite@4.4.0(lightningcss@1.21.5)(terser@5.18.2): resolution: {integrity: sha512-Wf+DCEjuM8aGavEYiF77hnbxEZ+0+/jC9nABR46sh5Xi+GYeSvkeEFRiVuI3x+tPjxgZeS91h1jTAQTPFgePpA==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -4561,6 +4658,7 @@ packages: optional: true dependencies: esbuild: 0.18.11 + lightningcss: 1.21.5 postcss: 8.4.24 rollup: 3.26.0 terser: 5.18.2 diff --git a/vite.config.js b/vite.config.js index 86086d08..bd5e3c5b 100644 --- a/vite.config.js +++ b/vite.config.js @@ -73,5 +73,6 @@ export default defineConfig({ }, build: { sourcemap: true, + cssMinify: "lightningcss", }, });