feat: refactor Vite plugin loading mechanism and improve plugin management
This commit is contained in:
@@ -4,5 +4,6 @@
|
||||
"tabWidth": 2,
|
||||
"singleQuote": true,
|
||||
"printWidth": 100,
|
||||
"trailingComma": "all"
|
||||
"trailingComma": "all",
|
||||
"plugins": ["@prettier/plugin-oxc"]
|
||||
}
|
||||
|
||||
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -14,6 +14,9 @@
|
||||
// 代码格式化相关配置
|
||||
// ============================================================
|
||||
"prettier.enable": true,
|
||||
"files.readonlyInclude": {
|
||||
"dist/**": true
|
||||
},
|
||||
"eslint.enable": true,
|
||||
"oxc.enable": true,
|
||||
"stylelint.enable": true,
|
||||
|
||||
2
auto-imports.d.ts
vendored
2
auto-imports.d.ts
vendored
@@ -65,7 +65,6 @@ declare global {
|
||||
const isRef: typeof import('vue').isRef
|
||||
const isShallow: typeof import('vue').isShallow
|
||||
const makeDestructurable: typeof import('@vueuse/core').makeDestructurable
|
||||
const manualResetRef: typeof import('@vueuse/core').manualResetRef
|
||||
const mapActions: typeof import('pinia').mapActions
|
||||
const mapGetters: typeof import('pinia').mapGetters
|
||||
const mapState: typeof import('pinia').mapState
|
||||
@@ -411,7 +410,6 @@ declare module 'vue' {
|
||||
readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
|
||||
readonly isShallow: UnwrapRef<typeof import('vue')['isShallow']>
|
||||
readonly makeDestructurable: UnwrapRef<typeof import('@vueuse/core')['makeDestructurable']>
|
||||
readonly manualResetRef: UnwrapRef<typeof import('@vueuse/core')['manualResetRef']>
|
||||
readonly mapActions: UnwrapRef<typeof import('pinia')['mapActions']>
|
||||
readonly mapGetters: UnwrapRef<typeof import('pinia')['mapGetters']>
|
||||
readonly mapState: UnwrapRef<typeof import('pinia')['mapState']>
|
||||
|
||||
25
package.json
25
package.json
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"packageManager": "pnpm@10.23.0",
|
||||
"packageManager": "pnpm@10.25.0",
|
||||
"name": "vue-ts-example-2025",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
@@ -14,7 +14,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"all": "run-s lint format:prettier build-only type-check test:unit:DisableWatch",
|
||||
"dev": "nodemon -w 'vite-plugins/**/*.ts' -e .ts -x vite --port 4730 --host --strictPort",
|
||||
"dev": "nodemon --delay 280ms --watch vite-plugins --ext ts -x vite -- --port 4730 --host --strictPort",
|
||||
"build": "run-p type-check \"build-only {@}\" --",
|
||||
"build-only": "vite build",
|
||||
"preview": "vite preview --port 4731 --host --strictPort",
|
||||
@@ -71,7 +71,7 @@
|
||||
"primelocale": "^2.2.2",
|
||||
"primevue": "^4.4.1",
|
||||
"ts-enum-util": "^4.1.0",
|
||||
"utils4u": "^4.2.3",
|
||||
"utils4u": "^5",
|
||||
"vue": "^3.5.24",
|
||||
"vue-i18n": "^11.2.1",
|
||||
"vue-memoize-dict": "^1.1.3",
|
||||
@@ -86,8 +86,8 @@
|
||||
"@iconify-json/material-symbols": "^1.2.47",
|
||||
"@intlify/eslint-plugin-vue-i18n": "^4.1.0",
|
||||
"@intlify/unplugin-vue-i18n": "^11.0.1",
|
||||
"@playwright/test": "^1.56.1",
|
||||
"@prettier/plugin-oxc": "^0.1.0",
|
||||
"@playwright/test": "^1.57.0",
|
||||
"@prettier/plugin-oxc": "^0.1.3",
|
||||
"@primevue/auto-import-resolver": "^4.4.1",
|
||||
"@primevue/metadata": "^4.4.1",
|
||||
"@stylelint-types/stylelint-order": "^7.0.0",
|
||||
@@ -106,11 +106,12 @@
|
||||
"@vue/eslint-config-typescript": "^14.6.0",
|
||||
"@vue/test-utils": "^2.4.6",
|
||||
"@vue/tsconfig": "^0.8.1",
|
||||
"boxen": "^8.0.1",
|
||||
"consola": "^3.4.2",
|
||||
"eslint": "^9.39.1",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-jsonc": "^2.21.0",
|
||||
"eslint-plugin-oxlint": "~1.29.0",
|
||||
"eslint-plugin-oxlint": "~1.32.0",
|
||||
"eslint-plugin-perfectionist": "^4.15.1",
|
||||
"eslint-plugin-playwright": "^2.3.0",
|
||||
"eslint-plugin-vue": "~10.6.0",
|
||||
@@ -124,7 +125,7 @@
|
||||
"nprogress": "^0.2.0",
|
||||
"oxlint": "~1.29.0",
|
||||
"postcss-html": "^1.8.0",
|
||||
"prettier": "3.6.2",
|
||||
"prettier": "3.7.4",
|
||||
"rollup": "^4.53.3",
|
||||
"sass-embedded": "^1.93.3",
|
||||
"sharp": "^0.34.5",
|
||||
@@ -156,13 +157,7 @@
|
||||
"vue-component-type-helpers": "^3.1.4",
|
||||
"vue-i18n-extract": "^2.0.7",
|
||||
"vue-macros": "3.1.1",
|
||||
"vue-tsc": "^3.1.4",
|
||||
"vue-tsc": "^3.1.8",
|
||||
"wrangler": "^4.50.0"
|
||||
},
|
||||
"overrides": {
|
||||
"vue-tsc": "$vue-tsc"
|
||||
},
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
174
pnpm-lock.yaml
generated
174
pnpm-lock.yaml
generated
@@ -4,6 +4,9 @@ settings:
|
||||
autoInstallPeers: true
|
||||
excludeLinksFromLockfile: false
|
||||
|
||||
overrides:
|
||||
vue-tsc: ^3.1.8
|
||||
|
||||
importers:
|
||||
|
||||
.:
|
||||
@@ -60,8 +63,8 @@ importers:
|
||||
specifier: ^4.1.0
|
||||
version: 4.1.0
|
||||
utils4u:
|
||||
specifier: ^4.2.3
|
||||
version: 4.2.3(@vueuse/core@14.1.0(vue@3.5.25(typescript@5.9.3)))(nprogress@0.2.0)(primevue@4.4.1(vue@3.5.25(typescript@5.9.3)))(vue-router@4.6.3(vue@3.5.25(typescript@5.9.3)))(vue@3.5.25(typescript@5.9.3))
|
||||
specifier: ^5
|
||||
version: 5.0.1(@vueuse/core@14.1.0(vue@3.5.25(typescript@5.9.3)))(nprogress@0.2.0)(primevue@4.4.1(vue@3.5.25(typescript@5.9.3)))(vue-router@4.6.3(vue@3.5.25(typescript@5.9.3)))(vue@3.5.25(typescript@5.9.3))
|
||||
vue:
|
||||
specifier: ^3.5.24
|
||||
version: 3.5.25(typescript@5.9.3)
|
||||
@@ -100,10 +103,10 @@ importers:
|
||||
specifier: ^11.0.1
|
||||
version: 11.0.1(@vue/compiler-dom@3.5.25)(eslint@9.39.1(jiti@2.6.1))(rollup@4.53.3)(typescript@5.9.3)(vue-i18n@11.2.2(vue@3.5.25(typescript@5.9.3)))(vue@3.5.25(typescript@5.9.3))
|
||||
'@playwright/test':
|
||||
specifier: ^1.56.1
|
||||
specifier: ^1.57.0
|
||||
version: 1.57.0
|
||||
'@prettier/plugin-oxc':
|
||||
specifier: ^0.1.0
|
||||
specifier: ^0.1.3
|
||||
version: 0.1.3
|
||||
'@primevue/auto-import-resolver':
|
||||
specifier: ^4.4.1
|
||||
@@ -149,7 +152,7 @@ importers:
|
||||
version: 1.4.3(eslint@9.39.1(jiti@2.6.1))(typescript@5.9.3)(vitest@4.0.14(@types/node@24.10.1)(happy-dom@20.0.10)(jiti@2.6.1)(jsdom@27.2.0)(lightningcss@1.30.1)(sass-embedded@1.93.3)(sass@1.93.3)(terser@5.44.1)(yaml@2.8.2))
|
||||
'@vue/eslint-config-prettier':
|
||||
specifier: ^10.2.0
|
||||
version: 10.2.0(eslint@9.39.1(jiti@2.6.1))(prettier@3.6.2)
|
||||
version: 10.2.0(eslint@9.39.1(jiti@2.6.1))(prettier@3.7.4)
|
||||
'@vue/eslint-config-typescript':
|
||||
specifier: ^14.6.0
|
||||
version: 14.6.0(eslint-plugin-vue@10.6.0(@stylistic/eslint-plugin@5.6.1(eslint@9.39.1(jiti@2.6.1)))(@typescript-eslint/parser@8.47.0(eslint@9.39.1(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.1(jiti@2.6.1))(vue-eslint-parser@10.2.0(eslint@9.39.1(jiti@2.6.1))))(eslint@9.39.1(jiti@2.6.1))(typescript@5.9.3)
|
||||
@@ -159,6 +162,9 @@ importers:
|
||||
'@vue/tsconfig':
|
||||
specifier: ^0.8.1
|
||||
version: 0.8.1(typescript@5.9.3)(vue@3.5.25(typescript@5.9.3))
|
||||
boxen:
|
||||
specifier: ^8.0.1
|
||||
version: 8.0.1
|
||||
consola:
|
||||
specifier: ^3.4.2
|
||||
version: 3.4.2
|
||||
@@ -172,8 +178,8 @@ importers:
|
||||
specifier: ^2.21.0
|
||||
version: 2.21.0(eslint@9.39.1(jiti@2.6.1))
|
||||
eslint-plugin-oxlint:
|
||||
specifier: ~1.29.0
|
||||
version: 1.29.0
|
||||
specifier: ~1.32.0
|
||||
version: 1.32.0
|
||||
eslint-plugin-perfectionist:
|
||||
specifier: ^4.15.1
|
||||
version: 4.15.1(eslint@9.39.1(jiti@2.6.1))(typescript@5.9.3)
|
||||
@@ -217,8 +223,8 @@ importers:
|
||||
specifier: ^1.8.0
|
||||
version: 1.8.0
|
||||
prettier:
|
||||
specifier: 3.6.2
|
||||
version: 3.6.2
|
||||
specifier: 3.7.4
|
||||
version: 3.7.4
|
||||
rollup:
|
||||
specifier: ^4.53.3
|
||||
version: 4.53.3
|
||||
@@ -284,7 +290,7 @@ importers:
|
||||
version: 7.2.7(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.1)(sass-embedded@1.93.3)(sass@1.93.3)(terser@5.44.1)(yaml@2.8.2)
|
||||
vite-plugin-checker:
|
||||
specifier: ^0.11.0
|
||||
version: 0.11.0(eslint@9.39.1(jiti@2.6.1))(meow@13.2.0)(optionator@0.9.4)(oxlint@1.29.0)(stylelint@16.26.0(typescript@5.9.3))(typescript@5.9.3)(vite@7.2.7(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.1)(sass-embedded@1.93.3)(sass@1.93.3)(terser@5.44.1)(yaml@2.8.2))(vue-tsc@3.1.5(typescript@5.9.3))
|
||||
version: 0.11.0(eslint@9.39.1(jiti@2.6.1))(meow@13.2.0)(optionator@0.9.4)(oxlint@1.29.0)(stylelint@16.26.0(typescript@5.9.3))(typescript@5.9.3)(vite@7.2.7(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.1)(sass-embedded@1.93.3)(sass@1.93.3)(terser@5.44.1)(yaml@2.8.2))(vue-tsc@3.1.8(typescript@5.9.3))
|
||||
vite-plugin-fake-server:
|
||||
specifier: ^2.2.2
|
||||
version: 2.2.2
|
||||
@@ -311,10 +317,10 @@ importers:
|
||||
version: 2.0.7
|
||||
vue-macros:
|
||||
specifier: 3.1.1
|
||||
version: 3.1.1(@vueuse/core@14.1.0(vue@3.5.25(typescript@5.9.3)))(esbuild@0.25.12)(rollup@4.53.3)(typescript@5.9.3)(vite@7.2.7(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.1)(sass-embedded@1.93.3)(sass@1.93.3)(terser@5.44.1)(yaml@2.8.2))(vue-tsc@3.1.5(typescript@5.9.3))(vue@3.5.25(typescript@5.9.3))
|
||||
version: 3.1.1(@vueuse/core@14.1.0(vue@3.5.25(typescript@5.9.3)))(esbuild@0.25.12)(rollup@4.53.3)(typescript@5.9.3)(vite@7.2.7(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.1)(sass-embedded@1.93.3)(sass@1.93.3)(terser@5.44.1)(yaml@2.8.2))(vue-tsc@3.1.8(typescript@5.9.3))(vue@3.5.25(typescript@5.9.3))
|
||||
vue-tsc:
|
||||
specifier: ^3.1.4
|
||||
version: 3.1.5(typescript@5.9.3)
|
||||
specifier: ^3.1.8
|
||||
version: 3.1.8(typescript@5.9.3)
|
||||
wrangler:
|
||||
specifier: ^4.50.0
|
||||
version: 4.50.0
|
||||
@@ -2455,11 +2461,17 @@ packages:
|
||||
'@volar/language-core@2.4.23':
|
||||
resolution: {integrity: sha512-hEEd5ET/oSmBC6pi1j6NaNYRWoAiDhINbT8rmwtINugR39loROSlufGdYMF9TaKGfz+ViGs1Idi3mAhnuPcoGQ==}
|
||||
|
||||
'@volar/language-core@2.4.26':
|
||||
resolution: {integrity: sha512-hH0SMitMxnB43OZpyF1IFPS9bgb2I3bpCh76m2WEK7BE0A0EzpYsRp0CCH2xNKshr7kacU5TQBLYn4zj7CG60A==}
|
||||
|
||||
'@volar/source-map@2.4.23':
|
||||
resolution: {integrity: sha512-Z1Uc8IB57Lm6k7q6KIDu/p+JWtf3xsXJqAX/5r18hYOTpJyBn0KXUR8oTJ4WFYOcDzWC9n3IflGgHowx6U6z9Q==}
|
||||
|
||||
'@volar/typescript@2.4.23':
|
||||
resolution: {integrity: sha512-lAB5zJghWxVPqfcStmAP1ZqQacMpe90UrP5RJ3arDyrhy4aCUQqmxPPLB2PWDKugvylmO41ljK7vZ+t6INMTag==}
|
||||
'@volar/source-map@2.4.26':
|
||||
resolution: {integrity: sha512-JJw0Tt/kSFsIRmgTQF4JSt81AUSI1aEye5Zl65EeZ8H35JHnTvFGmpDOBn5iOxd48fyGE+ZvZBp5FcgAy/1Qhw==}
|
||||
|
||||
'@volar/typescript@2.4.26':
|
||||
resolution: {integrity: sha512-N87ecLD48Sp6zV9zID/5yuS1+5foj0DfuYGdQ6KHj/IbKvyKv1zNX6VCmnKYwtmHadEO6mFc2EKISiu3RDPAvA==}
|
||||
|
||||
'@vue-macros/api@3.1.1':
|
||||
resolution: {integrity: sha512-e35DvgfLal0v2z/5sbcs1M++OKLoXRJoVIcCseNwZsGZFMShZ44KeOMIzBow4qT7/Gl/ms4p8bBSMlAHdSIS6g==}
|
||||
@@ -2619,7 +2631,7 @@ packages:
|
||||
resolution: {integrity: sha512-3AVhFqOfvru3Orj6CO4uudmFO7JAsFSReBbbsZEsK9V4cc5tVzfk8SL1kTNQ1FIEam3A2vWxeFTkSuVCD2x7OA==}
|
||||
engines: {node: '>=20.19.0'}
|
||||
peerDependencies:
|
||||
vue-tsc: 3.0.8
|
||||
vue-tsc: ^3.1.8
|
||||
peerDependenciesMeta:
|
||||
vue-tsc:
|
||||
optional: true
|
||||
@@ -2730,6 +2742,14 @@ packages:
|
||||
typescript:
|
||||
optional: true
|
||||
|
||||
'@vue/language-core@3.1.8':
|
||||
resolution: {integrity: sha512-PfwAW7BLopqaJbneChNL6cUOTL3GL+0l8paYP5shhgY5toBNidWnMXWM+qDwL7MC9+zDtzCF2enT8r6VPu64iw==}
|
||||
peerDependencies:
|
||||
typescript: '*'
|
||||
peerDependenciesMeta:
|
||||
typescript:
|
||||
optional: true
|
||||
|
||||
'@vue/reactivity@3.5.25':
|
||||
resolution: {integrity: sha512-5xfAypCQepv4Jog1U4zn8cZIcbKKFka3AgWHEFQeK65OW+Ys4XybP6z2kKgws4YB43KGpqp5D/K3go2UPPunLA==}
|
||||
|
||||
@@ -2817,6 +2837,9 @@ packages:
|
||||
alien-signals@3.1.1:
|
||||
resolution: {integrity: sha512-ogkIWbVrLwKtHY6oOAXaYkAxP+cTH7V5FZ5+Tm4NZFd8VDZ6uNMDrfzqctTZ42eTMCSR3ne3otpcxmqSnFfPYA==}
|
||||
|
||||
ansi-align@3.0.1:
|
||||
resolution: {integrity: sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==}
|
||||
|
||||
ansi-colors@4.1.3:
|
||||
resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==}
|
||||
engines: {node: '>=6'}
|
||||
@@ -2945,6 +2968,10 @@ packages:
|
||||
boolbase@1.0.0:
|
||||
resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==}
|
||||
|
||||
boxen@8.0.1:
|
||||
resolution: {integrity: sha512-F3PH5k5juxom4xktynS7MoFY+NUWH5LC4CnH11YB8NPew+HLpmBLCybSAEyb2F+4pRXhuhWqFesoQd6DAyc2hw==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
brace-expansion@1.1.12:
|
||||
resolution: {integrity: sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==}
|
||||
|
||||
@@ -2999,6 +3026,10 @@ packages:
|
||||
camel-case@4.1.2:
|
||||
resolution: {integrity: sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==}
|
||||
|
||||
camelcase@8.0.0:
|
||||
resolution: {integrity: sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==}
|
||||
engines: {node: '>=16'}
|
||||
|
||||
caniuse-lite@1.0.30001756:
|
||||
resolution: {integrity: sha512-4HnCNKbMLkLdhJz3TToeVWHSnfJvPaq6vu/eRP0Ahub/07n484XHhBF5AJoSGHdVrS8tKFauUQz8Bp9P7LVx7A==}
|
||||
|
||||
@@ -3030,6 +3061,10 @@ packages:
|
||||
resolution: {integrity: sha512-D5J+kHaVb/wKSFcyyV75uCn8fiY4sV38XJoe4CUyGQ+mOU/fMVYUdH1hJC+CJQ5uY3EnW27SbJYS4X8BiLrAFg==}
|
||||
engines: {node: '>= 10.0'}
|
||||
|
||||
cli-boxes@3.0.0:
|
||||
resolution: {integrity: sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
cli-cursor@5.0.0:
|
||||
resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==}
|
||||
engines: {node: '>=18'}
|
||||
@@ -3497,8 +3532,8 @@ packages:
|
||||
peerDependencies:
|
||||
eslint: '>=6.0.0'
|
||||
|
||||
eslint-plugin-oxlint@1.29.0:
|
||||
resolution: {integrity: sha512-VmaZ1I0lXJVJokOpnV8F7e339hcFPln5EWY8KGCdTkBnrkRmAeH25GRO6F37lZEDO9e+px5xjqbkq9g3lejBdg==}
|
||||
eslint-plugin-oxlint@1.32.0:
|
||||
resolution: {integrity: sha512-CodKgz/9q3euGbCYrXVRyFxHfnrxn9Q4EywqE4V/VYegry2pJ9/hPQ0OUDTRzbl3/pPbVndkrUUm5tK8NTSgeg==}
|
||||
|
||||
eslint-plugin-perfectionist@4.15.1:
|
||||
resolution: {integrity: sha512-MHF0cBoOG0XyBf7G0EAFCuJJu4I18wy0zAoT1OHfx2o6EOx1EFTIzr2HGeuZa1kDcusoX0xJ9V7oZmaeFd773Q==}
|
||||
@@ -4946,8 +4981,8 @@ packages:
|
||||
resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==}
|
||||
engines: {node: '>=6.0.0'}
|
||||
|
||||
prettier@3.6.2:
|
||||
resolution: {integrity: sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==}
|
||||
prettier@3.7.4:
|
||||
resolution: {integrity: sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA==}
|
||||
engines: {node: '>=14'}
|
||||
hasBin: true
|
||||
|
||||
@@ -5629,6 +5664,10 @@ packages:
|
||||
resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}
|
||||
engines: {node: '>= 0.8.0'}
|
||||
|
||||
type-fest@4.41.0:
|
||||
resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==}
|
||||
engines: {node: '>=16'}
|
||||
|
||||
type-fest@5.2.0:
|
||||
resolution: {integrity: sha512-xxCJm+Bckc6kQBknN7i9fnP/xobQRsRQxR01CztFkp/h++yfVxUUcmMgfR2HttJx/dpWjS9ubVuyspJv24Q9DA==}
|
||||
engines: {node: '>=20'}
|
||||
@@ -5843,8 +5882,8 @@ packages:
|
||||
util-deprecate@1.0.2:
|
||||
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
|
||||
|
||||
utils4u@4.2.3:
|
||||
resolution: {integrity: sha512-K0pZJ/84GqnGtx2mx3hTr8daKi0N7WHHKHX5KIR3lF9slBVXiW1yXLqFpSpEN3bWIwN2DufYo5BDCiRvZtoiTQ==}
|
||||
utils4u@5.0.1:
|
||||
resolution: {integrity: sha512-lD6LDEuFWEYkf7MZX6oybJtts8bm8BElYbfa5LsblgThe3YwNABEMfOCmIYK+gXoEcVhvFHwgVf/1d8mmmgzIQ==}
|
||||
peerDependencies:
|
||||
'@vueuse/core': '>=12.3.0'
|
||||
dayjs: ^1.11.13
|
||||
@@ -5904,7 +5943,7 @@ packages:
|
||||
vite: '>=5.4.20'
|
||||
vls: '*'
|
||||
vti: '*'
|
||||
vue-tsc: ~2.2.10 || ^3.0.0
|
||||
vue-tsc: ^3.1.8
|
||||
peerDependenciesMeta:
|
||||
'@biomejs/biome':
|
||||
optional: true
|
||||
@@ -6120,8 +6159,8 @@ packages:
|
||||
peerDependencies:
|
||||
vue: ^3.5.0
|
||||
|
||||
vue-tsc@3.1.5:
|
||||
resolution: {integrity: sha512-L/G9IUjOWhBU0yun89rv8fKqmKC+T0HfhrFjlIml71WpfBv9eb4E9Bev8FMbyueBIU9vxQqbd+oOsVcDa5amGw==}
|
||||
vue-tsc@3.1.8:
|
||||
resolution: {integrity: sha512-deKgwx6exIHeZwF601P1ktZKNF0bepaSN4jBU3AsbldPx9gylUc1JDxYppl82yxgkAgaz0Y0LCLOi+cXe9HMYA==}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
typescript: '>=5.0.0'
|
||||
@@ -6201,6 +6240,10 @@ packages:
|
||||
engines: {node: '>=8'}
|
||||
hasBin: true
|
||||
|
||||
widest-line@5.0.0:
|
||||
resolution: {integrity: sha512-c9bZp7b5YtRj2wOe6dlj32MK+Bx/M/d+9VB2SHM1OtsUHR0aV0tdP6DWh/iMt0kWi1t5g1Iudu6hQRNd1A4PVA==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
word-wrap@1.2.5:
|
||||
resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
@@ -8220,11 +8263,17 @@ snapshots:
|
||||
dependencies:
|
||||
'@volar/source-map': 2.4.23
|
||||
|
||||
'@volar/language-core@2.4.26':
|
||||
dependencies:
|
||||
'@volar/source-map': 2.4.26
|
||||
|
||||
'@volar/source-map@2.4.23': {}
|
||||
|
||||
'@volar/typescript@2.4.23':
|
||||
'@volar/source-map@2.4.26': {}
|
||||
|
||||
'@volar/typescript@2.4.26':
|
||||
dependencies:
|
||||
'@volar/language-core': 2.4.23
|
||||
'@volar/language-core': 2.4.26
|
||||
path-browserify: 1.0.1
|
||||
vscode-uri: 3.1.0
|
||||
|
||||
@@ -8443,7 +8492,7 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- vue
|
||||
|
||||
'@vue-macros/volar@3.1.1(typescript@5.9.3)(vue-tsc@3.1.5(typescript@5.9.3))(vue@3.5.25(typescript@5.9.3))':
|
||||
'@vue-macros/volar@3.1.1(typescript@5.9.3)(vue-tsc@3.1.8(typescript@5.9.3))(vue@3.5.25(typescript@5.9.3))':
|
||||
dependencies:
|
||||
'@vue-macros/boolean-prop': 3.1.1(vue@3.5.25(typescript@5.9.3))
|
||||
'@vue-macros/common': 3.1.1(vue@3.5.25(typescript@5.9.3))
|
||||
@@ -8455,7 +8504,7 @@ snapshots:
|
||||
muggle-string: 0.4.1
|
||||
ts-macro: 0.3.6
|
||||
optionalDependencies:
|
||||
vue-tsc: 3.1.5(typescript@5.9.3)
|
||||
vue-tsc: 3.1.8(typescript@5.9.3)
|
||||
transitivePeerDependencies:
|
||||
- typescript
|
||||
- vue
|
||||
@@ -8603,12 +8652,12 @@ snapshots:
|
||||
dependencies:
|
||||
rfdc: 1.4.1
|
||||
|
||||
'@vue/eslint-config-prettier@10.2.0(eslint@9.39.1(jiti@2.6.1))(prettier@3.6.2)':
|
||||
'@vue/eslint-config-prettier@10.2.0(eslint@9.39.1(jiti@2.6.1))(prettier@3.7.4)':
|
||||
dependencies:
|
||||
eslint: 9.39.1(jiti@2.6.1)
|
||||
eslint-config-prettier: 10.1.8(eslint@9.39.1(jiti@2.6.1))
|
||||
eslint-plugin-prettier: 5.5.4(eslint-config-prettier@10.1.8(eslint@9.39.1(jiti@2.6.1)))(eslint@9.39.1(jiti@2.6.1))(prettier@3.6.2)
|
||||
prettier: 3.6.2
|
||||
eslint-plugin-prettier: 5.5.4(eslint-config-prettier@10.1.8(eslint@9.39.1(jiti@2.6.1)))(eslint@9.39.1(jiti@2.6.1))(prettier@3.7.4)
|
||||
prettier: 3.7.4
|
||||
transitivePeerDependencies:
|
||||
- '@types/eslint'
|
||||
|
||||
@@ -8650,6 +8699,18 @@ snapshots:
|
||||
optionalDependencies:
|
||||
typescript: 5.9.3
|
||||
|
||||
'@vue/language-core@3.1.8(typescript@5.9.3)':
|
||||
dependencies:
|
||||
'@volar/language-core': 2.4.26
|
||||
'@vue/compiler-dom': 3.5.25
|
||||
'@vue/shared': 3.5.25
|
||||
alien-signals: 3.1.1
|
||||
muggle-string: 0.4.1
|
||||
path-browserify: 1.0.1
|
||||
picomatch: 4.0.3
|
||||
optionalDependencies:
|
||||
typescript: 5.9.3
|
||||
|
||||
'@vue/reactivity@3.5.25':
|
||||
dependencies:
|
||||
'@vue/shared': 3.5.25
|
||||
@@ -8734,6 +8795,10 @@ snapshots:
|
||||
|
||||
alien-signals@3.1.1: {}
|
||||
|
||||
ansi-align@3.0.1:
|
||||
dependencies:
|
||||
string-width: 4.2.3
|
||||
|
||||
ansi-colors@4.1.3: {}
|
||||
|
||||
ansi-escapes@7.2.0:
|
||||
@@ -8867,6 +8932,17 @@ snapshots:
|
||||
|
||||
boolbase@1.0.0: {}
|
||||
|
||||
boxen@8.0.1:
|
||||
dependencies:
|
||||
ansi-align: 3.0.1
|
||||
camelcase: 8.0.0
|
||||
chalk: 5.6.2
|
||||
cli-boxes: 3.0.0
|
||||
string-width: 7.2.0
|
||||
type-fest: 4.41.0
|
||||
widest-line: 5.0.0
|
||||
wrap-ansi: 9.0.2
|
||||
|
||||
brace-expansion@1.1.12:
|
||||
dependencies:
|
||||
balanced-match: 1.0.2
|
||||
@@ -8935,6 +9011,8 @@ snapshots:
|
||||
pascal-case: 3.1.2
|
||||
tslib: 2.8.1
|
||||
|
||||
camelcase@8.0.0: {}
|
||||
|
||||
caniuse-lite@1.0.30001756: {}
|
||||
|
||||
chai@6.2.1: {}
|
||||
@@ -8970,6 +9048,8 @@ snapshots:
|
||||
dependencies:
|
||||
source-map: 0.6.1
|
||||
|
||||
cli-boxes@3.0.0: {}
|
||||
|
||||
cli-cursor@5.0.0:
|
||||
dependencies:
|
||||
restore-cursor: 5.1.0
|
||||
@@ -9547,7 +9627,7 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- '@eslint/json'
|
||||
|
||||
eslint-plugin-oxlint@1.29.0:
|
||||
eslint-plugin-oxlint@1.32.0:
|
||||
dependencies:
|
||||
jsonc-parser: 3.3.1
|
||||
|
||||
@@ -9566,10 +9646,10 @@ snapshots:
|
||||
eslint: 9.39.1(jiti@2.6.1)
|
||||
globals: 16.5.0
|
||||
|
||||
eslint-plugin-prettier@5.5.4(eslint-config-prettier@10.1.8(eslint@9.39.1(jiti@2.6.1)))(eslint@9.39.1(jiti@2.6.1))(prettier@3.6.2):
|
||||
eslint-plugin-prettier@5.5.4(eslint-config-prettier@10.1.8(eslint@9.39.1(jiti@2.6.1)))(eslint@9.39.1(jiti@2.6.1))(prettier@3.7.4):
|
||||
dependencies:
|
||||
eslint: 9.39.1(jiti@2.6.1)
|
||||
prettier: 3.6.2
|
||||
prettier: 3.7.4
|
||||
prettier-linter-helpers: 1.0.0
|
||||
synckit: 0.11.11
|
||||
optionalDependencies:
|
||||
@@ -10961,7 +11041,7 @@ snapshots:
|
||||
dependencies:
|
||||
fast-diff: 1.3.0
|
||||
|
||||
prettier@3.6.2: {}
|
||||
prettier@3.7.4: {}
|
||||
|
||||
primeicons@7.0.0: {}
|
||||
|
||||
@@ -11737,6 +11817,8 @@ snapshots:
|
||||
dependencies:
|
||||
prelude-ls: 1.2.1
|
||||
|
||||
type-fest@4.41.0: {}
|
||||
|
||||
type-fest@5.2.0:
|
||||
dependencies:
|
||||
tagged-tag: 1.0.0
|
||||
@@ -11997,7 +12079,7 @@ snapshots:
|
||||
|
||||
util-deprecate@1.0.2: {}
|
||||
|
||||
utils4u@4.2.3(@vueuse/core@14.1.0(vue@3.5.25(typescript@5.9.3)))(nprogress@0.2.0)(primevue@4.4.1(vue@3.5.25(typescript@5.9.3)))(vue-router@4.6.3(vue@3.5.25(typescript@5.9.3)))(vue@3.5.25(typescript@5.9.3)):
|
||||
utils4u@5.0.1(@vueuse/core@14.1.0(vue@3.5.25(typescript@5.9.3)))(nprogress@0.2.0)(primevue@4.4.1(vue@3.5.25(typescript@5.9.3)))(vue-router@4.6.3(vue@3.5.25(typescript@5.9.3)))(vue@3.5.25(typescript@5.9.3)):
|
||||
optionalDependencies:
|
||||
'@vueuse/core': 14.1.0(vue@3.5.25(typescript@5.9.3))
|
||||
nprogress: 0.2.0
|
||||
@@ -12022,7 +12104,7 @@ snapshots:
|
||||
dependencies:
|
||||
vite: 7.2.7(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.1)(sass-embedded@1.93.3)(sass@1.93.3)(terser@5.44.1)(yaml@2.8.2)
|
||||
|
||||
vite-plugin-checker@0.11.0(eslint@9.39.1(jiti@2.6.1))(meow@13.2.0)(optionator@0.9.4)(oxlint@1.29.0)(stylelint@16.26.0(typescript@5.9.3))(typescript@5.9.3)(vite@7.2.7(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.1)(sass-embedded@1.93.3)(sass@1.93.3)(terser@5.44.1)(yaml@2.8.2))(vue-tsc@3.1.5(typescript@5.9.3)):
|
||||
vite-plugin-checker@0.11.0(eslint@9.39.1(jiti@2.6.1))(meow@13.2.0)(optionator@0.9.4)(oxlint@1.29.0)(stylelint@16.26.0(typescript@5.9.3))(typescript@5.9.3)(vite@7.2.7(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.1)(sass-embedded@1.93.3)(sass@1.93.3)(terser@5.44.1)(yaml@2.8.2))(vue-tsc@3.1.8(typescript@5.9.3)):
|
||||
dependencies:
|
||||
'@babel/code-frame': 7.27.1
|
||||
chokidar: 4.0.3
|
||||
@@ -12040,7 +12122,7 @@ snapshots:
|
||||
oxlint: 1.29.0
|
||||
stylelint: 16.26.0(typescript@5.9.3)
|
||||
typescript: 5.9.3
|
||||
vue-tsc: 3.1.5(typescript@5.9.3)
|
||||
vue-tsc: 3.1.8(typescript@5.9.3)
|
||||
|
||||
vite-plugin-fake-server@2.2.2:
|
||||
dependencies:
|
||||
@@ -12224,7 +12306,7 @@ snapshots:
|
||||
'@vue/devtools-api': 6.6.4
|
||||
vue: 3.5.25(typescript@5.9.3)
|
||||
|
||||
vue-macros@3.1.1(@vueuse/core@14.1.0(vue@3.5.25(typescript@5.9.3)))(esbuild@0.25.12)(rollup@4.53.3)(typescript@5.9.3)(vite@7.2.7(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.1)(sass-embedded@1.93.3)(sass@1.93.3)(terser@5.44.1)(yaml@2.8.2))(vue-tsc@3.1.5(typescript@5.9.3))(vue@3.5.25(typescript@5.9.3)):
|
||||
vue-macros@3.1.1(@vueuse/core@14.1.0(vue@3.5.25(typescript@5.9.3)))(esbuild@0.25.12)(rollup@4.53.3)(typescript@5.9.3)(vite@7.2.7(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.1)(sass-embedded@1.93.3)(sass@1.93.3)(terser@5.44.1)(yaml@2.8.2))(vue-tsc@3.1.8(typescript@5.9.3))(vue@3.5.25(typescript@5.9.3)):
|
||||
dependencies:
|
||||
'@vue-macros/better-define': 3.1.1(vue@3.5.25(typescript@5.9.3))
|
||||
'@vue-macros/boolean-prop': 3.1.1(vue@3.5.25(typescript@5.9.3))
|
||||
@@ -12254,7 +12336,7 @@ snapshots:
|
||||
'@vue-macros/short-bind': 3.1.1(vue@3.5.25(typescript@5.9.3))
|
||||
'@vue-macros/short-emits': 3.1.1(vue@3.5.25(typescript@5.9.3))
|
||||
'@vue-macros/short-vmodel': 3.1.1(vue@3.5.25(typescript@5.9.3))
|
||||
'@vue-macros/volar': 3.1.1(typescript@5.9.3)(vue-tsc@3.1.5(typescript@5.9.3))(vue@3.5.25(typescript@5.9.3))
|
||||
'@vue-macros/volar': 3.1.1(typescript@5.9.3)(vue-tsc@3.1.8(typescript@5.9.3))(vue@3.5.25(typescript@5.9.3))
|
||||
unplugin: 2.3.11
|
||||
unplugin-combine: 2.1.3(esbuild@0.25.12)(rollup@4.53.3)(unplugin@2.3.11)(vite@7.2.7(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.1)(sass-embedded@1.93.3)(sass@1.93.3)(terser@5.44.1)(yaml@2.8.2))
|
||||
unplugin-vue-define-options: 3.1.1(vue@3.5.25(typescript@5.9.3))
|
||||
@@ -12282,10 +12364,10 @@ snapshots:
|
||||
'@vue/devtools-api': 6.6.4
|
||||
vue: 3.5.25(typescript@5.9.3)
|
||||
|
||||
vue-tsc@3.1.5(typescript@5.9.3):
|
||||
vue-tsc@3.1.8(typescript@5.9.3):
|
||||
dependencies:
|
||||
'@volar/typescript': 2.4.23
|
||||
'@vue/language-core': 3.1.5(typescript@5.9.3)
|
||||
'@volar/typescript': 2.4.26
|
||||
'@vue/language-core': 3.1.8(typescript@5.9.3)
|
||||
typescript: 5.9.3
|
||||
|
||||
vue@3.5.25(typescript@5.9.3):
|
||||
@@ -12388,6 +12470,10 @@ snapshots:
|
||||
siginfo: 2.0.0
|
||||
stackback: 0.0.2
|
||||
|
||||
widest-line@5.0.0:
|
||||
dependencies:
|
||||
string-width: 7.2.0
|
||||
|
||||
word-wrap@1.2.5: {}
|
||||
|
||||
workerd@1.20251118.0:
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
packages:
|
||||
- 'packages/*'
|
||||
# shamefullyHoist: false # https://pnpm.io/zh/settings#shamefullyhoist
|
||||
|
||||
overrides:
|
||||
vue-tsc: $vue-tsc
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import vueJsx from '@vitejs/plugin-vue-jsx';
|
||||
import vueRouter from 'unplugin-vue-router/vite';
|
||||
import type { ConfigEnv, PluginOption } from 'vite';
|
||||
import VueMacros from 'vue-macros/vite';
|
||||
|
||||
export async function loadPlugin(_configEnv: ConfigEnv): Promise<PluginOption> {
|
||||
import type { LoadPluginFunction } from './_loadPlugins';
|
||||
|
||||
export const loadPlugin: LoadPluginFunction = async (_pluginLoadOptions) => {
|
||||
return [
|
||||
VueMacros({
|
||||
plugins: {
|
||||
@@ -24,9 +25,9 @@ export async function loadPlugin(_configEnv: ConfigEnv): Promise<PluginOption> {
|
||||
route.addToMeta({ _: route.fullPath });
|
||||
}
|
||||
},
|
||||
logs: true,
|
||||
logs: !true,
|
||||
}),
|
||||
},
|
||||
}),
|
||||
];
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import type { ConfigEnv, PluginOption } from 'vite';
|
||||
import UnoCSS from 'unocss/vite';
|
||||
|
||||
export function loadPlugin(_configEnv: ConfigEnv): PluginOption {
|
||||
import type { LoadPluginFunction } from './_loadPlugins';
|
||||
|
||||
export const loadPlugin: LoadPluginFunction = (_pluginLoadOptions) => {
|
||||
return [
|
||||
// https://github.com/antfu/unocss
|
||||
// see uno.config.ts for config
|
||||
@@ -9,4 +10,4 @@ export function loadPlugin(_configEnv: ConfigEnv): PluginOption {
|
||||
checkImport: true,
|
||||
}),
|
||||
];
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
|
||||
import type { ConfigEnv, PluginOption } from 'vite';
|
||||
|
||||
export function loadPlugin(_configEnv: ConfigEnv): PluginOption {
|
||||
import type { LoadPluginFunction } from './_loadPlugins';
|
||||
|
||||
export const loadPlugin: LoadPluginFunction = (_pluginLoadOptions) => {
|
||||
return [
|
||||
// https://github.com/intlify/bundle-tools/tree/main/packages/unplugin-vue-i18n
|
||||
VueI18nPlugin({
|
||||
@@ -17,4 +18,4 @@ export function loadPlugin(_configEnv: ConfigEnv): PluginOption {
|
||||
// },
|
||||
}),
|
||||
];
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import type { ConfigEnv, PluginOption } from 'vite';
|
||||
import Markdown from 'unplugin-vue-markdown/vite';
|
||||
|
||||
export function loadPlugin(_configEnv: ConfigEnv): PluginOption {
|
||||
import type { LoadPluginFunction } from './_loadPlugins';
|
||||
|
||||
export const loadPlugin: LoadPluginFunction = (_pluginLoadOptions) => {
|
||||
return [
|
||||
// https://github.com/unplugin/unplugin-vue-markdown
|
||||
Markdown({
|
||||
headEnabled: true,
|
||||
}),
|
||||
];
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import type { ConfigEnv, PluginOption } from 'vite';
|
||||
import MetaLayouts from 'vite-plugin-vue-meta-layouts';
|
||||
|
||||
export function loadPlugin(_configEnv: ConfigEnv): PluginOption {
|
||||
import type { LoadPluginFunction } from './_loadPlugins';
|
||||
|
||||
export const loadPlugin: LoadPluginFunction = (_pluginLoadOptions) => {
|
||||
return [
|
||||
// https://github.com/dishait/vite-plugin-vue-meta-layouts
|
||||
MetaLayouts({
|
||||
@@ -16,4 +17,4 @@ export function loadPlugin(_configEnv: ConfigEnv): PluginOption {
|
||||
skipTopLevelRouteLayout: true, // 打开修复 https://github.com/JohnCampionJr/vite-plugin-vue-layouts/issues/134,默认为 false 关闭
|
||||
}),
|
||||
];
|
||||
}
|
||||
};
|
||||
|
||||
@@ -9,7 +9,6 @@ import Icons from 'unplugin-icons/vite';
|
||||
import Components from 'unplugin-vue-components/vite';
|
||||
import { VueRouterAutoImports } from 'unplugin-vue-router';
|
||||
import { createUtils4uAutoImports } from 'utils4u/auto-imports';
|
||||
import type { ConfigEnv, PluginOption } from 'vite';
|
||||
|
||||
// >>>>>
|
||||
// eslint-disable-next-line import/no-duplicates
|
||||
@@ -26,6 +25,8 @@ import { PrimeVueResolver } from '@primevue/auto-import-resolver';
|
||||
import { VantResolver } from '@vant/auto-import-resolver';
|
||||
// <<<<<
|
||||
|
||||
import type { LoadPluginFunction } from './_loadPlugins';
|
||||
|
||||
function _getNaiveUiComponentNames() {
|
||||
// [dtsTsx](https://github.com/unplugin/unplugin-vue-components/pull/673/files/84e80738885cfe11298f41f070cda94a7a779276)
|
||||
|
||||
@@ -55,7 +56,7 @@ function _getNaiveUiComponentNames() {
|
||||
return [];
|
||||
}
|
||||
|
||||
export function loadPlugin(_configEnv: ConfigEnv): PluginOption {
|
||||
export const loadPlugin: LoadPluginFunction = (_pluginLoadOptions) => {
|
||||
return [
|
||||
// https://github.com/antfu/unplugin-auto-import
|
||||
AutoImport({
|
||||
@@ -141,4 +142,4 @@ export function loadPlugin(_configEnv: ConfigEnv): PluginOption {
|
||||
},
|
||||
}),
|
||||
];
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { minify as minifyHtml } from 'html-minifier-terser';
|
||||
import { loadEnv } from 'vite';
|
||||
import type { ConfigEnv, PluginOption } from 'vite';
|
||||
import type { PluginOption } from 'vite';
|
||||
|
||||
import type { LoadPluginFunction } from './_loadPlugins';
|
||||
|
||||
function IndexHtmlPlugin(): PluginOption {
|
||||
return {
|
||||
@@ -91,8 +92,14 @@ function ___(): PluginOption {
|
||||
};
|
||||
}
|
||||
|
||||
export function loadPlugin(_configEnv: ConfigEnv): PluginOption {
|
||||
export const loadPlugin: LoadPluginFunction = (pluginLoadOptions) => {
|
||||
const { mode, env } = pluginLoadOptions;
|
||||
// return [___()];
|
||||
const env = loadEnv(_configEnv.mode, process.cwd());
|
||||
if (env.VITE_BUILD_MINIFY === 'true') return IndexHtmlPlugin();
|
||||
}
|
||||
if (mode !== 'production') {
|
||||
return { plugins: [], message: '仅在生产模式下启用' };
|
||||
}
|
||||
if (env.VITE_BUILD_MINIFY !== 'true') {
|
||||
return { plugins: [], message: `已通过环境变量禁用: VITE_BUILD_MINIFY=${env.VITE_BUILD_MINIFY}` };
|
||||
}
|
||||
return IndexHtmlPlugin();
|
||||
};
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { consola } from 'consola';
|
||||
import type { ConfigEnv, PluginOption } from 'vite';
|
||||
import { vitePluginFakeServer } from 'vite-plugin-fake-server';
|
||||
// https://github.com/condorheroblog/vite-plugin-fake-server?tab=readme-ov-file#usage
|
||||
|
||||
export function loadPlugin(_configEnv: ConfigEnv): PluginOption {
|
||||
if (_configEnv.mode !== 'development') {
|
||||
consola.info('fake server plugin is disabled in non-development mode.');
|
||||
return [];
|
||||
import type { LoadPluginFunction } from './_loadPlugins';
|
||||
|
||||
// https://github.com/condorheroblog/vite-plugin-fake-server?tab=readme-ov-file#usage
|
||||
export const loadPlugin: LoadPluginFunction = (pluginLoadOptions) => {
|
||||
const { mode } = pluginLoadOptions;
|
||||
if (mode !== 'development') {
|
||||
return { plugins: [], message: '仅在开发模式下启用' };
|
||||
}
|
||||
return vitePluginFakeServer({
|
||||
basename: 'fake-api',
|
||||
enableProd: true,
|
||||
include: 'fake',
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import type { ConfigEnv, PluginOption } from 'vite';
|
||||
import { ViteImageOptimizer } from 'vite-plugin-image-optimizer';
|
||||
|
||||
export function loadPlugin(_configEnv: ConfigEnv): PluginOption {
|
||||
import type { LoadPluginFunction } from './_loadPlugins';
|
||||
|
||||
export const loadPlugin: LoadPluginFunction = (_pluginLoadOptions) => {
|
||||
return [
|
||||
// https://github.com/FatehAK/vite-plugin-image-optimizer?tab=readme-ov-file#default-configuration
|
||||
ViteImageOptimizer({
|
||||
/* pass your config */
|
||||
}),
|
||||
];
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,23 +1,27 @@
|
||||
import consola from 'consola';
|
||||
import type { ConfigEnv, PluginOption } from 'vite';
|
||||
import vueDevTools from 'vite-plugin-vue-devtools';
|
||||
|
||||
export function loadPlugin(configEnv: ConfigEnv): PluginOption {
|
||||
if (configEnv.mode !== 'development') {
|
||||
consola.info('vue-devtools 插件仅在开发模式下使用。');
|
||||
return [];
|
||||
import type { LoadPluginFunction } from './_loadPlugins';
|
||||
|
||||
export const loadPlugin: LoadPluginFunction = (_pluginLoadOptions) => {
|
||||
const { mode } = _pluginLoadOptions;
|
||||
if (mode !== 'development') {
|
||||
return { plugins: [], message: '仅在开发模式下启用' };
|
||||
}
|
||||
|
||||
let launchEditor = 'code';
|
||||
let message: string | undefined;
|
||||
|
||||
if (process.env.TERM_PROGRAM_VERSION?.toLowerCase()?.includes('insider')) {
|
||||
consola.info('检测到 VSCode Insiders 环境。');
|
||||
launchEditor = 'code-insiders';
|
||||
message = '检测到 VSCode Insiders 环境';
|
||||
}
|
||||
|
||||
return [
|
||||
return {
|
||||
plugins: [
|
||||
vueDevTools({
|
||||
launchEditor: launchEditor,
|
||||
}),
|
||||
];
|
||||
}
|
||||
],
|
||||
message,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
import { cloudflare } from '@cloudflare/vite-plugin';
|
||||
import { loadEnv } from 'vite';
|
||||
import type {ConfigEnv, PluginOption} from 'vite';
|
||||
|
||||
export function loadPlugin(_configEnv: ConfigEnv): PluginOption {
|
||||
const env = loadEnv(_configEnv.mode, process.cwd());
|
||||
if (_configEnv.mode === 'test') {
|
||||
console.log('cloudflare plugin disabled in test mode');
|
||||
return [];
|
||||
import type { LoadPluginFunction } from './_loadPlugins';
|
||||
|
||||
export const loadPlugin: LoadPluginFunction = (pluginLoadOptions) => {
|
||||
const { mode, env } = pluginLoadOptions;
|
||||
if (mode === 'test') {
|
||||
return { plugins: [], message: '在测试模式下禁用' };
|
||||
}
|
||||
if (env.VITE_CLOUDFLARE_SERVER_ENABLED !== 'true') {
|
||||
console.log('cloudflare plugin disabled by env');
|
||||
return [];
|
||||
return {
|
||||
plugins: [],
|
||||
message: `已通过环境变量禁用: VITE_CLOUDFLARE_SERVER_ENABLED=${env.VITE_CLOUDFLARE_SERVER_ENABLED}`,
|
||||
};
|
||||
}
|
||||
return [cloudflare()];
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,19 +1,29 @@
|
||||
import boxen from 'boxen';
|
||||
import consola from 'consola';
|
||||
import path from 'node:path';
|
||||
import { pathToFileURL } from 'node:url';
|
||||
|
||||
import consola from 'consola';
|
||||
import { glob } from 'tinyglobby';
|
||||
import type { ConfigEnv, PluginOption } from 'vite';
|
||||
import { loadEnv } from 'vite';
|
||||
|
||||
export type LoadPluginFunction = (
|
||||
configEnv: ConfigEnv & {
|
||||
env: Record<string, string>;
|
||||
},
|
||||
) => PluginOption | LoadPluginResult;
|
||||
export interface LoadPluginResult {
|
||||
plugins: PluginOption;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
type LoadPluginFunction = (configEnv: ConfigEnv) => PluginOption;
|
||||
export async function loadPlugins(configEnv: ConfigEnv): Promise<PluginOption[]> {
|
||||
const plugins: PluginOption[] = [];
|
||||
|
||||
consola.start('开始加载 Vite 插件...');
|
||||
const cwd = path.resolve(import.meta.dirname);
|
||||
|
||||
const pluginEntries = await glob('**/*.ts', {
|
||||
absolute: true,
|
||||
cwd: path.resolve(import.meta.dirname),
|
||||
cwd,
|
||||
ignore: [
|
||||
'**/*.d.ts',
|
||||
'**/*.disabled.ts',
|
||||
@@ -24,7 +34,14 @@ export async function loadPlugins(configEnv: ConfigEnv): Promise<PluginOption[]>
|
||||
],
|
||||
});
|
||||
|
||||
consola.info(`找到 ${pluginEntries.length} 个插件文件`);
|
||||
const relativeCwd = path.relative(process.cwd(), cwd);
|
||||
console.time('加载插件');
|
||||
consola.log(
|
||||
boxen(`正在加载 Vite 插件... (./${relativeCwd})`, {
|
||||
borderStyle: 'classic',
|
||||
borderColor: 'cyan',
|
||||
}),
|
||||
);
|
||||
|
||||
// 计算最长的文件名长度,用于对齐输出
|
||||
const maxNameLength = Math.max(...pluginEntries.map((entry) => path.basename(entry).length));
|
||||
@@ -41,20 +58,33 @@ export async function loadPlugins(configEnv: ConfigEnv): Promise<PluginOption[]>
|
||||
continue;
|
||||
}
|
||||
|
||||
const plugin = loadPlugin(configEnv);
|
||||
const env = loadEnv(configEnv.mode, process.cwd());
|
||||
const result = loadPlugin({ ...configEnv, env });
|
||||
|
||||
// 判断是否是 LoadPluginResult 对象
|
||||
const isResultObject = (val: unknown): val is LoadPluginResult =>
|
||||
typeof val === 'object' && val !== null && 'plugins' in val;
|
||||
|
||||
const plugin = isResultObject(result) ? result.plugins : result;
|
||||
const message = isResultObject(result) ? result.message : undefined;
|
||||
|
||||
const pluginArray = Array.isArray(plugin) ? plugin : [plugin];
|
||||
const validPlugins = pluginArray.filter(Boolean);
|
||||
const pluginCount = validPlugins.length;
|
||||
|
||||
if (pluginCount > 0) {
|
||||
plugins.push(...validPlugins);
|
||||
consola.success(`${paddedName} → ${pluginCount} 个实例`);
|
||||
const suffix = message ? ` (${message})` : '';
|
||||
consola.info(`${paddedName} → ${pluginCount} 个实例${suffix}`);
|
||||
} else if (message) {
|
||||
consola.info(`${paddedName} → ${message}`);
|
||||
} else {
|
||||
consola.info(`${paddedName} 返回了空数组或无效值`);
|
||||
}
|
||||
}
|
||||
|
||||
consola.success(`✅ 总共加载了 ${plugins.length} 个插件实例`);
|
||||
consola.success(`共 ${pluginEntries.length} 个插件文件,已加载 ${plugins.length} 个实例`);
|
||||
console.timeEnd('加载插件');
|
||||
|
||||
return plugins;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
import type { ConfigEnv, PluginOption } from 'vite';
|
||||
import { loadEnv } from 'vite';
|
||||
import type { LoadPluginFunction } from './_loadPlugins';
|
||||
|
||||
export default [
|
||||
// ...
|
||||
] satisfies PluginOption;
|
||||
export const loadPlugin: LoadPluginFunction = (_pluginLoadOptions) => {
|
||||
const env = _pluginLoadOptions.env;
|
||||
|
||||
export function loadPlugin(_configEnv: ConfigEnv): PluginOption {
|
||||
const env = loadEnv(_configEnv.mode, process.cwd());
|
||||
console.debug(`env :>> `, env);
|
||||
// ...
|
||||
return undefined;
|
||||
}
|
||||
// 示例:根据环境变量禁用插件并返回消息
|
||||
if (env.VITE_DEMO_ENABLED !== 'true') {
|
||||
return {
|
||||
plugins: [],
|
||||
message: `已通过环境变量禁用: VITE_DEMO_ENABLED=${env.VITE_DEMO_ENABLED}`,
|
||||
};
|
||||
}
|
||||
|
||||
// 正常返回插件
|
||||
return [];
|
||||
};
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
import type { PluginOption } from 'vite';
|
||||
|
||||
export default [
|
||||
// // 检查是否在VS Code终端中运行
|
||||
// if (process.env.TERM_PROGRAM === 'vscode' || process.env.VSCODE_PID) {
|
||||
// // plugins.push(
|
||||
// // // 构建后自动将dist目录打包成zip文件
|
||||
// // viteArchiverPlugin({
|
||||
// // addTimestamp: false, // 是否添加时间戳到输出文件名
|
||||
// // format: 'zip', // 输出的压缩文件格式
|
||||
// // outputDir: '', // 输出目录,默认为项目根目录
|
||||
// // outputFileName: 'dist', // 输出的zip文件名(不含扩展名)
|
||||
// // sourceDir: 'dist', // 要打包的源目录
|
||||
// // }),
|
||||
// // )
|
||||
// }
|
||||
] satisfies PluginOption;
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ManualChunkMeta, PreRenderedAsset, RollupOptions } from 'rollup';
|
||||
import type { /* ManualChunkMeta, PreRenderedAsset, */ RollupOptions } from 'rollup';
|
||||
|
||||
import path from 'node:path';
|
||||
// import path from 'node:path';
|
||||
|
||||
// https://www.npmjs.com/package/utils4u/v/2.19.2?activeTab=code
|
||||
|
||||
@@ -12,106 +12,95 @@ export const viteConfigRollupOptions: RollupOptions = {
|
||||
if (warning.code === 'EVAL' && warning.id?.includes('node_modules/protobufjs')) return;
|
||||
warn(warning);
|
||||
}, */
|
||||
|
||||
output: {
|
||||
// Keep hashed file names predictable across entry, chunk, and asset outputs.
|
||||
entryFileNames: 'entry/[name].[hash].js', // 默认: "[name].js"
|
||||
chunkFileNames: 'chunk/[name].[hash].js', // 默认: "[name]-[hash].js"
|
||||
// assetFileNames:'', // 默认: "assets/[name]-[hash][extname]"
|
||||
// https://cn.rollupjs.org/configuration-options/#output-assetfilenames
|
||||
assetFileNames(chunkInfo: PreRenderedAsset) {
|
||||
const names = [...new Set(chunkInfo.names)];
|
||||
|
||||
if (names.length !== 1) {
|
||||
console.error('Multiple names for asset:', chunkInfo);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const assetName = names[0];
|
||||
const ext = assetName.split('.').pop()?.toLowerCase();
|
||||
if (ext && /png|jpe?g|gif|svg|webp|avif/.test(ext)) {
|
||||
return 'chunks/images/[name].[hash][extname]';
|
||||
}
|
||||
if (ext && /woff2?|ttf|otf/.test(ext)) {
|
||||
return 'chunks/fonts/[name].[hash][extname]';
|
||||
}
|
||||
if (ext === 'css') {
|
||||
return 'chunks/css/[name].[hash][extname]';
|
||||
}
|
||||
return '_chunks/[name].[hash][extname]';
|
||||
},
|
||||
|
||||
manualChunks: (id: string, _meta: ManualChunkMeta) => {
|
||||
// https://github.com/unocss/unocss/issues/4917
|
||||
// if (['/src/layouts'].some((prefix) => id.includes(prefix))) {
|
||||
// 如果一个 chunk 小于 10KB,Rollup 会尝试将它合并到其他 chunk 中。这样可以避免产生大量碎片文件
|
||||
experimentalMinChunkSize: 10 * 1024,
|
||||
// // Keep hashed file names predictable across entry, chunk, and asset outputs.
|
||||
// entryFileNames: 'entry/[name].[hash].js', // 默认: "[name].js"
|
||||
// chunkFileNames: 'chunk/[name].[hash].js', // 默认: "[name]-[hash].js"
|
||||
// // assetFileNames:'', // 默认: "assets/[name]-[hash][extname]"
|
||||
// // https://cn.rollupjs.org/configuration-options/#output-assetfilenames
|
||||
// assetFileNames(chunkInfo: PreRenderedAsset) {
|
||||
// const names = [...new Set(chunkInfo.names)];
|
||||
// if (names.length !== 1) {
|
||||
// console.error('Multiple names for asset:', chunkInfo);
|
||||
// process.exit(1);
|
||||
// }
|
||||
// const assetName = names[0];
|
||||
// const ext = assetName.split('.').pop()?.toLowerCase();
|
||||
// if (ext && /png|jpe?g|gif|svg|webp|avif/.test(ext)) {
|
||||
// return 'chunks/images/[name].[hash][extname]';
|
||||
// }
|
||||
// if (ext && /woff2?|ttf|otf/.test(ext)) {
|
||||
// return 'chunks/fonts/[name].[hash][extname]';
|
||||
// }
|
||||
// if (ext === 'css') {
|
||||
// return 'chunks/css/[name].[hash][extname]';
|
||||
// }
|
||||
// return '_chunks/[name].[hash][extname]';
|
||||
// },
|
||||
// manualChunks: (id: string, _meta: ManualChunkMeta) => {
|
||||
// // https://github.com/unocss/unocss/issues/4917
|
||||
// // if (['/src/layouts'].some((prefix) => id.includes(prefix))) {
|
||||
// // const url = new URL(id, 'file://');
|
||||
// // if (!url.search /* ?vue&type=script&setup=true&lang.ts */) {
|
||||
// // return 'layouts';
|
||||
// // }
|
||||
// // }
|
||||
// if (id.includes('meta-layouts')) {
|
||||
// // console.debug(`id :>> `, id); // id :>> virtual:meta-layouts
|
||||
// // 这里很奇怪,打印 id 是`virtual:meta-layouts`,但是 `'virtual:meta-layouts' === id` 却是 false
|
||||
// return 'lib-meta-layouts';
|
||||
// }
|
||||
// if (id.includes('index.page.vue')) {
|
||||
// const url = new URL(id, 'file://');
|
||||
// if (!url.search /* ?vue&type=script&setup=true&lang.ts */) {
|
||||
// return 'layouts';
|
||||
// const parentDir = path.basename(path.dirname(id));
|
||||
// return `${parentDir}-index.page`;
|
||||
// }
|
||||
// }
|
||||
|
||||
if (id.includes('meta-layouts')) {
|
||||
// console.debug(`id :>> `, id); // id :>> virtual:meta-layouts
|
||||
// 这里很奇怪,打印 id 是`virtual:meta-layouts`,但是 `'virtual:meta-layouts' === id` 却是 false
|
||||
return 'lib-meta-layouts';
|
||||
}
|
||||
|
||||
if (id.includes('index.page.vue')) {
|
||||
const url = new URL(id, 'file://');
|
||||
if (!url.search /* ?vue&type=script&setup=true&lang.ts */) {
|
||||
const parentDir = path.basename(path.dirname(id));
|
||||
return `${parentDir}-index.page`;
|
||||
}
|
||||
}
|
||||
|
||||
if (!id.includes('node_modules')) return;
|
||||
// 处理 pnpm 的特殊路径结构
|
||||
let packageName;
|
||||
if (id.includes('.pnpm')) {
|
||||
// pnpm 路径: .pnpm/naive-ui@2.43.1_vue@3.5.22/node_modules/naive-ui/...
|
||||
const pnpmMatch = id.match(/\.pnpm\/(.+?)@/);
|
||||
if (pnpmMatch) {
|
||||
packageName = pnpmMatch[1];
|
||||
}
|
||||
} else {
|
||||
// 普通路径: node_modules/lodash/...
|
||||
const normalMatch = id.match(/node_modules\/(@[^/]+\/[^/]+|[^/]+)\//);
|
||||
if (normalMatch) {
|
||||
packageName = normalMatch[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (packageName) {
|
||||
if (['highlight.js'].includes(packageName)) {
|
||||
return 'lib-hljs';
|
||||
}
|
||||
|
||||
// 根据包名分组
|
||||
if (['consola', 'lodash', '@juggle+resize-observer', 'vueuc'].includes(packageName)) {
|
||||
return 'lib-vendor';
|
||||
}
|
||||
|
||||
// // 拆了有问题
|
||||
// if (['naive-ui'].includes(packageName) && id.includes('_internal')) {
|
||||
// return 'lib-naive-ui-internal';
|
||||
// if (!id.includes('node_modules')) return;
|
||||
// // 处理 pnpm 的特殊路径结构
|
||||
// let packageName;
|
||||
// if (id.includes('.pnpm')) {
|
||||
// // pnpm 路径: .pnpm/naive-ui@2.43.1_vue@3.5.22/node_modules/naive-ui/...
|
||||
// const pnpmMatch = id.match(/\.pnpm\/(.+?)@/);
|
||||
// if (pnpmMatch) {
|
||||
// packageName = pnpmMatch[1];
|
||||
// }
|
||||
|
||||
if (['naive-ui'].includes(packageName)) {
|
||||
return 'lib-naive-ui';
|
||||
}
|
||||
|
||||
if (
|
||||
['primelocale', 'primevue', 'primeuix', 'primeicons'].some((name) =>
|
||||
packageName!.includes(name),
|
||||
)
|
||||
) {
|
||||
return 'lib-primevue';
|
||||
}
|
||||
|
||||
if (['vue', 'vue-router', 'pinia', 'vue-demi', 'vue-i18n'].includes(packageName)) {
|
||||
return 'lib-vue-vendor';
|
||||
}
|
||||
}
|
||||
},
|
||||
// } else {
|
||||
// // 普通路径: node_modules/lodash/...
|
||||
// const normalMatch = id.match(/node_modules\/(@[^/]+\/[^/]+|[^/]+)\//);
|
||||
// if (normalMatch) {
|
||||
// packageName = normalMatch[1];
|
||||
// }
|
||||
// }
|
||||
// if (packageName) {
|
||||
// if (['highlight.js'].includes(packageName)) {
|
||||
// return 'lib-hljs';
|
||||
// }
|
||||
// // 根据包名分组
|
||||
// if (['consola', 'lodash', '@juggle+resize-observer', 'vueuc'].includes(packageName)) {
|
||||
// return 'lib-vendor';
|
||||
// }
|
||||
// // // 拆了有问题
|
||||
// // if (['naive-ui'].includes(packageName) && id.includes('_internal')) {
|
||||
// // return 'lib-naive-ui-internal';
|
||||
// // }
|
||||
// if (['naive-ui'].includes(packageName)) {
|
||||
// return 'lib-naive-ui';
|
||||
// }
|
||||
// if (
|
||||
// ['primelocale', 'primevue', 'primeuix', 'primeicons'].some((name) =>
|
||||
// packageName!.includes(name),
|
||||
// )
|
||||
// ) {
|
||||
// return 'lib-primevue';
|
||||
// }
|
||||
// if (['vue', 'vue-router', 'pinia', 'vue-demi', 'vue-i18n'].includes(packageName)) {
|
||||
// return 'lib-vue-vendor';
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user