diff --git a/electron.vite.config.mts b/electron.vite.config.mts index 4d5b549d89..62345fff73 100644 --- a/electron.vite.config.mts +++ b/electron.vite.config.mts @@ -2,7 +2,7 @@ import { resolve, dirname, join } from 'node:path'; import { fileURLToPath } from 'node:url'; import { UserConfig } from 'vite'; -import { defineConfig, defineViteConfig } from 'electron-vite'; +import { defineConfig, defineViteConfig, swcPlugin } from 'electron-vite'; import builtinModules from 'builtin-modules'; import viteResolve from 'vite-plugin-resolve'; import Inspect from 'vite-plugin-inspect'; @@ -24,6 +24,7 @@ export default defineConfig({ main: defineViteConfig(({ mode }) => { const commonConfig: UserConfig = { plugins: [ + swcPlugin(), pluginLoader('backend'), viteResolve({ 'virtual:i18n': i18nImporter(), @@ -66,13 +67,14 @@ export default defineConfig({ build: { ...commonConfig.build, minify: true, - cssMinify: true, + cssMinify: 'lightningcss', }, }; }), preload: defineViteConfig(({ mode }) => { const commonConfig: UserConfig = { plugins: [ + swcPlugin(), pluginLoader('preload'), viteResolve({ 'virtual:i18n': i18nImporter(), @@ -114,13 +116,14 @@ export default defineConfig({ build: { ...commonConfig.build, minify: true, - cssMinify: true, + cssMinify: 'lightningcss', }, }; }), renderer: defineViteConfig(({ mode }) => { const commonConfig: UserConfig = { plugins: [ + swcPlugin(), pluginLoader('renderer'), viteResolve({ 'virtual:i18n': i18nImporter(), @@ -165,7 +168,7 @@ export default defineConfig({ build: { ...commonConfig.build, minify: true, - cssMinify: true, + cssMinify: 'lightningcss', }, }; }), diff --git a/package.json b/package.json index 6239df2b70..7d678bd7dd 100644 --- a/package.json +++ b/package.json @@ -286,6 +286,7 @@ "@eslint/js": "9.17.0", "@playwright/test": "1.49.1", "@stylistic/eslint-plugin-js": "2.12.1", + "@swc/core": "1.10.1", "@total-typescript/ts-reset": "0.6.1", "@types/color": "4.2.0", "@types/electron-localshortcut": "3.1.3", @@ -311,6 +312,7 @@ "eslint-plugin-import": "2.31.0", "eslint-plugin-prettier": "5.2.1", "glob": "11.0.0", + "lightningcss": "1.28.2", "node-gyp": "11.0.0", "playwright": "1.49.1", "rollup": "4.28.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f4aaccd3e8..259a58fe2d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -205,6 +205,9 @@ importers: '@stylistic/eslint-plugin-js': specifier: 2.12.1 version: 2.12.1(eslint@9.17.0) + '@swc/core': + specifier: 1.10.1 + version: 1.10.1 '@total-typescript/ts-reset': specifier: 0.6.1 version: 0.6.1 @@ -255,7 +258,7 @@ importers: version: 4.0.0 electron-vite: specifier: 2.3.0 - version: 2.3.0(vite@6.0.3(@types/node@22.9.3)(yaml@2.6.1)) + version: 2.3.0(@swc/core@1.10.1)(vite@6.0.3(@types/node@22.9.3)(lightningcss@1.28.2)(yaml@2.6.1)) esbuild: specifier: 0.24.0 version: 0.24.0 @@ -280,6 +283,9 @@ importers: glob: specifier: 11.0.0 version: 11.0.0 + lightningcss: + specifier: 1.28.2 + version: 1.28.2 node-gyp: specifier: 11.0.0 version: 11.0.0 @@ -300,16 +306,16 @@ importers: version: 6.0.5 vite: specifier: 6.0.3 - version: 6.0.3(@types/node@22.9.3)(yaml@2.6.1) + version: 6.0.3(@types/node@22.9.3)(lightningcss@1.28.2)(yaml@2.6.1) vite-plugin-inspect: specifier: 0.10.3 - version: 0.10.3(rollup@4.28.1)(vite@6.0.3(@types/node@22.9.3)(yaml@2.6.1)) + version: 0.10.3(rollup@4.28.1)(vite@6.0.3(@types/node@22.9.3)(lightningcss@1.28.2)(yaml@2.6.1)) vite-plugin-resolve: specifier: 2.5.2 version: 2.5.2 vite-plugin-solid: specifier: 2.11.0 - version: 2.11.0(solid-js@1.9.3)(vite@6.0.3(@types/node@22.9.3)(yaml@2.6.1)) + version: 2.11.0(solid-js@1.9.3)(vite@6.0.3(@types/node@22.9.3)(lightningcss@1.28.2)(yaml@2.6.1)) ws: specifier: 8.18.0 version: 8.18.0(bufferutil@4.0.8)(utf-8-validate@6.0.5) @@ -1262,6 +1268,81 @@ packages: peerDependencies: eslint: '>=8.40.0' + '@swc/core-darwin-arm64@1.10.1': + resolution: {integrity: sha512-NyELPp8EsVZtxH/mEqvzSyWpfPJ1lugpTQcSlMduZLj1EASLO4sC8wt8hmL1aizRlsbjCX+r0PyL+l0xQ64/6Q==} + engines: {node: '>=10'} + cpu: [arm64] + os: [darwin] + + '@swc/core-darwin-x64@1.10.1': + resolution: {integrity: sha512-L4BNt1fdQ5ZZhAk5qoDfUnXRabDOXKnXBxMDJ+PWLSxOGBbWE6aJTnu4zbGjJvtot0KM46m2LPAPY8ttknqaZA==} + engines: {node: '>=10'} + cpu: [x64] + os: [darwin] + + '@swc/core-linux-arm-gnueabihf@1.10.1': + resolution: {integrity: sha512-Y1u9OqCHgvVp2tYQAJ7hcU9qO5brDMIrA5R31rwWQIAKDkJKtv3IlTHF0hrbWk1wPR0ZdngkQSJZple7G+Grvw==} + engines: {node: '>=10'} + cpu: [arm] + os: [linux] + + '@swc/core-linux-arm64-gnu@1.10.1': + resolution: {integrity: sha512-tNQHO/UKdtnqjc7o04iRXng1wTUXPgVd8Y6LI4qIbHVoVPwksZydISjMcilKNLKIwOoUQAkxyJ16SlOAeADzhQ==} + engines: {node: '>=10'} + cpu: [arm64] + os: [linux] + + '@swc/core-linux-arm64-musl@1.10.1': + resolution: {integrity: sha512-x0L2Pd9weQ6n8dI1z1Isq00VHFvpBClwQJvrt3NHzmR+1wCT/gcYl1tp9P5xHh3ldM8Cn4UjWCw+7PaUgg8FcQ==} + engines: {node: '>=10'} + cpu: [arm64] + os: [linux] + + '@swc/core-linux-x64-gnu@1.10.1': + resolution: {integrity: sha512-yyYEwQcObV3AUsC79rSzN9z6kiWxKAVJ6Ntwq2N9YoZqSPYph+4/Am5fM1xEQYf/kb99csj0FgOelomJSobxQA==} + engines: {node: '>=10'} + cpu: [x64] + os: [linux] + + '@swc/core-linux-x64-musl@1.10.1': + resolution: {integrity: sha512-tcaS43Ydd7Fk7sW5ROpaf2Kq1zR+sI5K0RM+0qYLYYurvsJruj3GhBCaiN3gkzd8m/8wkqNqtVklWaQYSDsyqA==} + engines: {node: '>=10'} + cpu: [x64] + os: [linux] + + '@swc/core-win32-arm64-msvc@1.10.1': + resolution: {integrity: sha512-D3Qo1voA7AkbOzQ2UGuKNHfYGKL6eejN8VWOoQYtGHHQi1p5KK/Q7V1ku55oxXBsj79Ny5FRMqiRJpVGad7bjQ==} + engines: {node: '>=10'} + cpu: [arm64] + os: [win32] + + '@swc/core-win32-ia32-msvc@1.10.1': + resolution: {integrity: sha512-WalYdFoU3454Og+sDKHM1MrjvxUGwA2oralknXkXL8S0I/8RkWZOB++p3pLaGbTvOO++T+6znFbQdR8KRaa7DA==} + engines: {node: '>=10'} + cpu: [ia32] + os: [win32] + + '@swc/core-win32-x64-msvc@1.10.1': + resolution: {integrity: sha512-JWobfQDbTnoqaIwPKQ3DVSywihVXlQMbDuwik/dDWlj33A8oEHcjPOGs4OqcA3RHv24i+lfCQpM3Mn4FAMfacA==} + engines: {node: '>=10'} + cpu: [x64] + os: [win32] + + '@swc/core@1.10.1': + resolution: {integrity: sha512-rQ4dS6GAdmtzKiCRt3LFVxl37FaY1cgL9kSUTnhQ2xc3fmHOd7jdJK/V4pSZMG1ruGTd0bsi34O2R0Olg9Zo/w==} + engines: {node: '>=10'} + peerDependencies: + '@swc/helpers': '*' + peerDependenciesMeta: + '@swc/helpers': + optional: true + + '@swc/counter@0.1.3': + resolution: {integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==} + + '@swc/types@0.1.17': + resolution: {integrity: sha512-V5gRru+aD8YVyCOMAjMpWR1Ui577DD5KSJsHP8RAxopAH22jFz6GZd/qxqjO6MJHQhcsjvjOFXyDhyLQUnMveQ==} + '@szmarczak/http-timer@4.0.6': resolution: {integrity: sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==} engines: {node: '>=10'} @@ -1998,6 +2079,11 @@ packages: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} + detect-libc@1.0.3: + resolution: {integrity: sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==} + engines: {node: '>=0.10'} + hasBin: true + detect-node@2.1.0: resolution: {integrity: sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==} @@ -3037,6 +3123,70 @@ packages: lie@3.3.0: resolution: {integrity: sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==} + lightningcss-darwin-arm64@1.28.2: + resolution: {integrity: sha512-/8cPSqZiusHSS+WQz0W4NuaqFjquys1x+NsdN/XOHb+idGHJSoJ7SoQTVl3DZuAgtPZwFZgRfb/vd1oi8uX6+g==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [darwin] + + lightningcss-darwin-x64@1.28.2: + resolution: {integrity: sha512-R7sFrXlgKjvoEG8umpVt/yutjxOL0z8KWf0bfPT3cYMOW4470xu5qSHpFdIOpRWwl3FKNMUdbKtMUjYt0h2j4g==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [darwin] + + lightningcss-freebsd-x64@1.28.2: + resolution: {integrity: sha512-l2qrCT+x7crAY+lMIxtgvV10R8VurzHAoUZJaVFSlHrN8kRLTvEg9ObojIDIexqWJQvJcVVV3vfzsEynpiuvgA==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [freebsd] + + lightningcss-linux-arm-gnueabihf@1.28.2: + resolution: {integrity: sha512-DKMzpICBEKnL53X14rF7hFDu8KKALUJtcKdFUCW5YOlGSiwRSgVoRjM97wUm/E0NMPkzrTi/rxfvt7ruNK8meg==} + engines: {node: '>= 12.0.0'} + cpu: [arm] + os: [linux] + + lightningcss-linux-arm64-gnu@1.28.2: + resolution: {integrity: sha512-nhfjYkfymWZSxdtTNMWyhFk2ImUm0X7NAgJWFwnsYPOfmtWQEapzG/DXZTfEfMjSzERNUNJoQjPAbdqgB+sjiw==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + + lightningcss-linux-arm64-musl@1.28.2: + resolution: {integrity: sha512-1SPG1ZTNnphWvAv8RVOymlZ8BDtAg69Hbo7n4QxARvkFVCJAt0cgjAw1Fox0WEhf4PwnyoOBaVH0Z5YNgzt4dA==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + + lightningcss-linux-x64-gnu@1.28.2: + resolution: {integrity: sha512-ZhQy0FcO//INWUdo/iEdbefntTdpPVQ0XJwwtdbBuMQe+uxqZoytm9M+iqR9O5noWFaxK+nbS2iR/I80Q2Ofpg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + + lightningcss-linux-x64-musl@1.28.2: + resolution: {integrity: sha512-alb/j1NMrgQmSFyzTbN1/pvMPM+gdDw7YBuQ5VSgcFDypN3Ah0BzC2dTZbzwzaMdUVDszX6zH5MzjfVN1oGuww==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + + lightningcss-win32-arm64-msvc@1.28.2: + resolution: {integrity: sha512-WnwcjcBeAt0jGdjlgbT9ANf30pF0C/QMb1XnLnH272DQU8QXh+kmpi24R55wmWBwaTtNAETZ+m35ohyeMiNt+g==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [win32] + + lightningcss-win32-x64-msvc@1.28.2: + resolution: {integrity: sha512-3piBifyT3avz22o6mDKywQC/OisH2yDK+caHWkiMsF82i3m5wDBadyCjlCQ5VNgzYkxrWZgiaxHDdd5uxsi0/A==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [win32] + + lightningcss@1.28.2: + resolution: {integrity: sha512-ePLRrbt3fgjXI5VFZOLbvkLD5ZRuxGKm+wJ3ujCqBtL3NanDHPo/5zicR5uEKAPiIjBYF99BM4K4okvMznjkVA==} + engines: {node: '>= 12.0.0'} + locate-path@6.0.0: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} @@ -5284,6 +5434,58 @@ snapshots: eslint-visitor-keys: 4.2.0 espree: 10.3.0 + '@swc/core-darwin-arm64@1.10.1': + optional: true + + '@swc/core-darwin-x64@1.10.1': + optional: true + + '@swc/core-linux-arm-gnueabihf@1.10.1': + optional: true + + '@swc/core-linux-arm64-gnu@1.10.1': + optional: true + + '@swc/core-linux-arm64-musl@1.10.1': + optional: true + + '@swc/core-linux-x64-gnu@1.10.1': + optional: true + + '@swc/core-linux-x64-musl@1.10.1': + optional: true + + '@swc/core-win32-arm64-msvc@1.10.1': + optional: true + + '@swc/core-win32-ia32-msvc@1.10.1': + optional: true + + '@swc/core-win32-x64-msvc@1.10.1': + optional: true + + '@swc/core@1.10.1': + dependencies: + '@swc/counter': 0.1.3 + '@swc/types': 0.1.17 + optionalDependencies: + '@swc/core-darwin-arm64': 1.10.1 + '@swc/core-darwin-x64': 1.10.1 + '@swc/core-linux-arm-gnueabihf': 1.10.1 + '@swc/core-linux-arm64-gnu': 1.10.1 + '@swc/core-linux-arm64-musl': 1.10.1 + '@swc/core-linux-x64-gnu': 1.10.1 + '@swc/core-linux-x64-musl': 1.10.1 + '@swc/core-win32-arm64-msvc': 1.10.1 + '@swc/core-win32-ia32-msvc': 1.10.1 + '@swc/core-win32-x64-msvc': 1.10.1 + + '@swc/counter@0.1.3': {} + + '@swc/types@0.1.17': + dependencies: + '@swc/counter': 0.1.3 + '@szmarczak/http-timer@4.0.6': dependencies: defer-to-connect: 2.0.1 @@ -6214,6 +6416,8 @@ snapshots: delayed-stream@1.0.0: {} + detect-libc@1.0.3: {} + detect-node@2.1.0: optional: true @@ -6394,7 +6598,7 @@ snapshots: transitivePeerDependencies: - supports-color - electron-vite@2.3.0(vite@6.0.3(@types/node@22.9.3)(yaml@2.6.1)): + electron-vite@2.3.0(@swc/core@1.10.1)(vite@6.0.3(@types/node@22.9.3)(lightningcss@1.28.2)(yaml@2.6.1)): dependencies: '@babel/core': 7.26.0 '@babel/plugin-transform-arrow-functions': 7.25.9(@babel/core@7.26.0) @@ -6402,7 +6606,9 @@ snapshots: esbuild: 0.21.5 magic-string: 0.30.13 picocolors: 1.1.1 - vite: 6.0.3(@types/node@22.9.3)(yaml@2.6.1) + vite: 6.0.3(@types/node@22.9.3)(lightningcss@1.28.2)(yaml@2.6.1) + optionalDependencies: + '@swc/core': 1.10.1 transitivePeerDependencies: - supports-color @@ -7485,6 +7691,51 @@ snapshots: dependencies: immediate: 3.0.6 + lightningcss-darwin-arm64@1.28.2: + optional: true + + lightningcss-darwin-x64@1.28.2: + optional: true + + lightningcss-freebsd-x64@1.28.2: + optional: true + + lightningcss-linux-arm-gnueabihf@1.28.2: + optional: true + + lightningcss-linux-arm64-gnu@1.28.2: + optional: true + + lightningcss-linux-arm64-musl@1.28.2: + optional: true + + lightningcss-linux-x64-gnu@1.28.2: + optional: true + + lightningcss-linux-x64-musl@1.28.2: + optional: true + + lightningcss-win32-arm64-msvc@1.28.2: + optional: true + + lightningcss-win32-x64-msvc@1.28.2: + optional: true + + lightningcss@1.28.2: + dependencies: + detect-libc: 1.0.3 + optionalDependencies: + lightningcss-darwin-arm64: 1.28.2 + lightningcss-darwin-x64: 1.28.2 + lightningcss-freebsd-x64: 1.28.2 + lightningcss-linux-arm-gnueabihf: 1.28.2 + lightningcss-linux-arm64-gnu: 1.28.2 + lightningcss-linux-arm64-musl: 1.28.2 + lightningcss-linux-x64-gnu: 1.28.2 + lightningcss-linux-x64-musl: 1.28.2 + lightningcss-win32-arm64-msvc: 1.28.2 + lightningcss-win32-x64-msvc: 1.28.2 + locate-path@6.0.0: dependencies: p-locate: 5.0.0 @@ -8638,7 +8889,7 @@ snapshots: extsprintf: 1.4.1 optional: true - vite-plugin-inspect@0.10.3(rollup@4.28.1)(vite@6.0.3(@types/node@22.9.3)(yaml@2.6.1)): + vite-plugin-inspect@0.10.3(rollup@4.28.1)(vite@6.0.3(@types/node@22.9.3)(lightningcss@1.28.2)(yaml@2.6.1)): dependencies: '@antfu/utils': 0.7.10 '@rollup/pluginutils': 5.1.3(rollup@4.28.1) @@ -8649,7 +8900,7 @@ snapshots: perfect-debounce: 1.0.0 picocolors: 1.1.1 sirv: 3.0.0 - vite: 6.0.3(@types/node@22.9.3)(yaml@2.6.1) + vite: 6.0.3(@types/node@22.9.3)(lightningcss@1.28.2)(yaml@2.6.1) transitivePeerDependencies: - rollup - supports-color @@ -8658,7 +8909,7 @@ snapshots: dependencies: lib-esm: 0.4.2 - vite-plugin-solid@2.11.0(solid-js@1.9.3)(vite@6.0.3(@types/node@22.9.3)(yaml@2.6.1)): + vite-plugin-solid@2.11.0(solid-js@1.9.3)(vite@6.0.3(@types/node@22.9.3)(lightningcss@1.28.2)(yaml@2.6.1)): dependencies: '@babel/core': 7.26.0 '@types/babel__core': 7.20.5 @@ -8666,12 +8917,12 @@ snapshots: merge-anything: 5.1.7 solid-js: 1.9.3 solid-refresh: 0.6.3(solid-js@1.9.3) - vite: 6.0.3(@types/node@22.9.3)(yaml@2.6.1) - vitefu: 1.0.4(vite@6.0.3(@types/node@22.9.3)(yaml@2.6.1)) + vite: 6.0.3(@types/node@22.9.3)(lightningcss@1.28.2)(yaml@2.6.1) + vitefu: 1.0.4(vite@6.0.3(@types/node@22.9.3)(lightningcss@1.28.2)(yaml@2.6.1)) transitivePeerDependencies: - supports-color - vite@6.0.3(@types/node@22.9.3)(yaml@2.6.1): + vite@6.0.3(@types/node@22.9.3)(lightningcss@1.28.2)(yaml@2.6.1): dependencies: esbuild: 0.24.0 postcss: 8.4.49 @@ -8679,11 +8930,12 @@ snapshots: optionalDependencies: '@types/node': 22.9.3 fsevents: 2.3.3 + lightningcss: 1.28.2 yaml: 2.6.1 - vitefu@1.0.4(vite@6.0.3(@types/node@22.9.3)(yaml@2.6.1)): + vitefu@1.0.4(vite@6.0.3(@types/node@22.9.3)(lightningcss@1.28.2)(yaml@2.6.1)): optionalDependencies: - vite: 6.0.3(@types/node@22.9.3)(yaml@2.6.1) + vite: 6.0.3(@types/node@22.9.3)(lightningcss@1.28.2)(yaml@2.6.1) vudio@2.1.1(patch_hash=7iux5msqpgl3octdmwy4uspwoe): {}