void 0.10.4 → 0.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents-Bmr5tFFb.mjs +1454 -0
- package/dist/{auth-cmd-CblKzAdD.mjs → auth-cmd-DlgNwByu.mjs} +10 -10
- package/dist/{better-auth-shared-D0Mbmx5V.mjs → better-auth-shared-BQooDxbw.mjs} +1 -1
- package/dist/{better-auth-shared-jkksALri.d.mts → better-auth-shared-BvnM9px6.d.mts} +2 -2
- package/dist/{build-cmd-CJQSRupz.mjs → build-cmd-Br8qL0rA.mjs} +15 -17
- package/dist/{cache-CMzjhxHh.mjs → cache-wH-mP8UE.mjs} +10 -12
- package/dist/{cancel-deploy-S2N8NSv6.mjs → cancel-deploy-BEBOEgtu.mjs} +16 -18
- package/dist/cli/cli.mjs +62 -51
- package/dist/{client-YIzxv2ZO.mjs → client-Cj96iiBH.mjs} +118 -8
- package/dist/{config-8dLIngKW.mjs → config-1twldYCW.mjs} +10 -10
- package/dist/{config--wXmVOoe.mjs → config-BdUctCZD.mjs} +6 -6
- package/dist/{create-project-pLQdzEPe.mjs → create-project-DD9n8Ho-.mjs} +28 -23
- package/dist/{db-hAmBumot.mjs → db-DjKE2-A-.mjs} +151 -150
- package/dist/{delete-CfSe3EJO.mjs → delete-D2kr3Kmk.mjs} +13 -15
- package/dist/{deploy-DpOdwtla.mjs → deploy-C4PbkFyE.mjs} +114 -119
- package/dist/{discover-C8N1I4tK.mjs → discover-BuVVSAum.mjs} +4 -4
- package/dist/{dist-5cGIJHQQ.mjs → dist-BuiRJkTd.mjs} +59 -27
- package/dist/{domain-CkowysQx.mjs → domain-_luIsM_B.mjs} +14 -16
- package/dist/{env-CIwG2y7G.mjs → env-CO5XAS9t.mjs} +23 -25
- package/dist/{env-helpers-B_ks681T.d.mts → env-helpers-z4stu8uc.d.mts} +1 -1
- package/dist/{env-types-CaJaIRXU.mjs → env-types-D51bnR-c.mjs} +4 -4
- package/dist/{env-validation-LH6eoyW-.mjs → env-validation-CeC2FL66.mjs} +4 -4
- package/dist/{fetch-error-C6qffTl2.mjs → fetch-error-Dj3crt0e.mjs} +3 -3
- package/dist/{gen-q6McxXgE.mjs → gen-Cf79J4aw.mjs} +42 -44
- package/dist/{github-cmd-BvEKQmcD.mjs → github-cmd-DnqxyOsb.mjs} +197 -91
- package/dist/{handler-B7rCOy21.d.mts → handler-imD0UVDT.d.mts} +4 -5
- package/dist/{headers-BNWymgnH.mjs → headers-BwvFGhkx.mjs} +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +102 -83
- package/dist/{init-CZP69LJu.mjs → init-KirOzVDs.mjs} +132 -134
- package/dist/link-CUmiosyb.mjs +45 -0
- package/dist/{list-B7qXBBjo.mjs → list-3GEw7b6m.mjs} +10 -12
- package/dist/{login-B3l_sDwT.mjs → login-DJReaT_Q.mjs} +14 -15
- package/dist/{logs-AXm660MB.mjs → logs-D-rQ56Lq.mjs} +9 -11
- package/dist/{magic-string.es-C1Fb0uxq.mjs → magic-string.es-ZQjdJFFn.mjs} +3 -3
- package/dist/{mcp-D2plINxM.mjs → mcp-D7yc0dXY.mjs} +2 -3
- package/dist/{node-B07cZs0d.mjs → node-yFFk626c.mjs} +6 -6
- package/dist/{package-json-Bg_GJdJB.mjs → package-json-B0NuUWGd.mjs} +1 -1
- package/dist/pages/client.d.mts +1 -1
- package/dist/pages/client.mjs +2 -1
- package/dist/pages/head-client.d.mts +1 -1
- package/dist/pages/head.d.mts +1 -1
- package/dist/pages/index.d.mts +2 -2
- package/dist/pages/index.mjs +5 -5
- package/dist/pages/islands-plugin.d.mts +1 -1
- package/dist/pages/islands-plugin.mjs +3 -3
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +5 -2
- package/dist/{plugin-inference-C3fLzFvP.mjs → plugin-inference-CJxi_fWI.mjs} +4 -4
- package/dist/{prepare-DRRboRqH.mjs → prepare-C_cVurhP.mjs} +15 -18
- package/dist/{preset-B7ZQZn0u.mjs → preset-CVvwCeIy.mjs} +4 -4
- package/dist/{project-cmd-InegJruy.mjs → project-cmd-DnU7u9QF.mjs} +13 -14
- package/dist/{project-paths-CCMrHYQm.mjs → project-paths-tpdR1mJR.mjs} +2 -2
- package/dist/{project-tsconfig-BTNuNoJ0.mjs → project-tsconfig-D9uSVVpA.mjs} +4 -4
- package/dist/{protocol-6UZCowS1.d.mts → protocol-6hTJ04T1.d.mts} +3 -3
- package/dist/{resolve-project-D4O1_fZz.mjs → resolve-project-D2HI3TrG.mjs} +2 -2
- package/dist/{rollback-CHVE-DeT.mjs → rollback-Yh7bCKob.mjs} +21 -23
- package/dist/{route-types-D03ryMXz.mjs → route-types-CfKfhbIg.mjs} +234 -3
- package/dist/{runner-BQyKUqAL.mjs → runner-h272wcPj.mjs} +4 -5
- package/dist/{runner-pg-EuhrFW3D.mjs → runner-pg-waxJOnBb.mjs} +1 -1
- package/dist/runtime/ai.mjs +2 -2
- package/dist/runtime/auth.d.mts +1 -1
- package/dist/runtime/better-auth-pg.d.mts +1 -1
- package/dist/runtime/better-auth-pg.mjs +3 -3
- package/dist/runtime/better-auth.d.mts +1 -1
- package/dist/runtime/better-auth.mjs +2 -2
- package/dist/runtime/client-react.d.mts +2 -2
- package/dist/runtime/client-react.mjs +1 -1
- package/dist/runtime/client-solid.d.mts +2 -2
- package/dist/runtime/client-solid.mjs +1 -1
- package/dist/runtime/client-svelte.d.mts +2 -2
- package/dist/runtime/client-svelte.mjs +1 -1
- package/dist/runtime/client-vue.d.mts +2 -2
- package/dist/runtime/client-vue.mjs +1 -1
- package/dist/runtime/client.d.mts +2 -2
- package/dist/runtime/client.mjs +1 -1
- package/dist/runtime/db-pg.d.mts +1 -1
- package/dist/runtime/env-helpers.d.mts +1 -1
- package/dist/runtime/env-public-client.d.mts +1 -1
- package/dist/runtime/env-public-client.mjs +2 -0
- package/dist/runtime/env-public.d.mts +3 -4
- package/dist/runtime/env-public.mjs +3 -1
- package/dist/runtime/env.mjs +1 -1
- package/dist/runtime/fetch-stream.d.mts +1 -1
- package/dist/runtime/fetch-stream.mjs +1 -1
- package/dist/runtime/fetch.d.mts +1 -1
- package/dist/runtime/fetch.mjs +1 -1
- package/dist/runtime/handler.d.mts +2 -2
- package/dist/runtime/handler.mjs +1 -1
- package/dist/runtime/isr.mjs +1 -1
- package/dist/runtime/live-server.mjs +2 -0
- package/dist/runtime/live.d.mts +2 -2
- package/dist/runtime/live.mjs +3 -1
- package/dist/runtime/migration-handler-pg.mjs +1 -1
- package/dist/runtime/migration-handler.mjs +1 -1
- package/dist/runtime/remote/index.mjs +11 -1
- package/dist/runtime/sandbox.d.mts +1 -4
- package/dist/runtime/sandbox.mjs +1 -1
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +2 -2
- package/dist/runtime/ws-server.mjs +2 -0
- package/dist/runtime/ws.d.mts +3 -3
- package/dist/runtime/ws.mjs +2 -0
- package/dist/{scan-VCAM1oh3.mjs → scan-Dp_Gyzs3.mjs} +3 -3
- package/dist/{scan-DGEp1-1Q.mjs → scan-i7Yz54fv.mjs} +26 -8
- package/dist/{secret-CVKwIOm3.mjs → secret-u7FRvg8d.mjs} +22 -24
- package/dist/{skills-Dl3u05da.mjs → skills-DsdNDtX3.mjs} +6 -7
- package/dist/{subcommand-prompt-B8ng0FTS.mjs → subcommand-prompt-DtES-oP6.mjs} +34 -35
- package/dist/sveltekit.mjs +2 -2
- package/dist/validate-DT7nFMlf.mjs +504 -0
- package/dist/{yarn-pnp-WLW2IHUY.mjs → yarn-pnp-CW8LB6g_.mjs} +1 -1
- package/package.json +19 -19
- package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/CHANGELOG.md +94 -0
- package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/README.md +32 -11
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/sandbox/README.md +45 -0
- package/skills/void/docs/node_modules/void/node_modules/@electric-sql/pglite/README.md +5 -5
- package/skills/void/docs/node_modules/void/node_modules/@types/node/README.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@types/node/README.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-exit/README.md +4 -1
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-attrs/README.md +29 -12
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/tinyglobby/README.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/AGENTS.md +1 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/README.md +18 -6
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/build.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/check.md +35 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/create.md +70 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/fmt.md +3 -1
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/index.md +11 -7
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/lint.md +3 -1
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/pack.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/run.md +141 -26
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/staged.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/test.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/automatic-data-tracking.md +145 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/cache.md +16 -28
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/check.md +16 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/ci.md +15 -17
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/commit-hooks.md +9 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/create.md +255 -2
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/docker.md +175 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/env.md +70 -5
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/github-actions-cache.md +165 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/ide-integration.md +2 -2
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/index.md +9 -3
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/install.md +63 -11
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/migrate-rules.md +347 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/migrate.md +27 -3
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/monorepo.md +176 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/pack.md +8 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/run.md +36 -4
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/troubleshooting.md +11 -35
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/upgrade.md +65 -13
- package/skills/void/docs/node_modules/void/node_modules/es-module-lexer/README.md +403 -390
- package/skills/void/docs/node_modules/void/node_modules/pg/README.md +2 -1
- package/skills/void/docs/node_modules/void/node_modules/tinyglobby/README.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/AGENTS.md +1 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/README.md +18 -6
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/build.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/check.md +35 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/create.md +70 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/fmt.md +3 -1
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/index.md +11 -7
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/lint.md +3 -1
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/pack.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/run.md +141 -26
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/staged.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/test.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/automatic-data-tracking.md +145 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/cache.md +16 -28
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/check.md +16 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/ci.md +15 -17
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/commit-hooks.md +9 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/create.md +255 -2
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/docker.md +175 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/env.md +70 -5
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/github-actions-cache.md +165 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/ide-integration.md +2 -2
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/index.md +9 -3
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/install.md +63 -11
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/migrate-rules.md +347 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/migrate.md +27 -3
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/monorepo.md +176 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/pack.md +8 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/run.md +36 -4
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/troubleshooting.md +11 -35
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/upgrade.md +65 -13
- package/skills/void/docs/reference/cli.md +19 -1
- package/dist/agents-MhSzNMiC.mjs +0 -151
- package/dist/collect-9rO3JFNM.mjs +0 -55
- package/dist/config-hhMYPVRT.mjs +0 -21
- package/dist/dist-abzUneor.mjs +0 -1287
- package/dist/drizzle-DqstQTGq.mjs +0 -232
- package/dist/link-BKLElphS.mjs +0 -47
- package/dist/output-DeiS4oEX.mjs +0 -139
- package/dist/plan-aD3wRDqF.mjs +0 -271
- package/dist/project-CH9pdo16.mjs +0 -72
- package/dist/project-slug-rX3kTOfY.mjs +0 -10
- package/dist/validate-CNWm-PsL.mjs +0 -186
- /package/dist/{auth-migrations-BP-hMzYl.mjs → auth-migrations-BTZ-ATvQ.mjs} +0 -0
- /package/dist/{auth-Dz2CCn4T.d.mts → auth-qgMlYp7Z.d.mts} +0 -0
- /package/dist/{canonical-json-CEyQaVDa.mjs → canonical-json-DuDiiUsQ.mjs} +0 -0
- /package/dist/{cf-access-DKDsgwOU.mjs → cf-access-Bqw81xAf.mjs} +0 -0
- /package/dist/{defer-C-bdSM_b.mjs → defer-YsYDUoii.mjs} +0 -0
- /package/dist/{dotenv-lS94ymhM.mjs → dotenv-D_UbC_vc.mjs} +0 -0
- /package/dist/{env-raw-Dtj1UAoK.mjs → env-raw-CoS20LHP.mjs} +0 -0
- /package/dist/{fetch-error-B6RaJ-eZ.d.mts → fetch-error-Sp1R4mZv.d.mts} +0 -0
- /package/dist/{git-metadata-Ce0AtSZL.mjs → git-metadata-CBKaL0v5.mjs} +0 -0
- /package/dist/{head-eOUCWUNy.d.mts → head-nmvOgFjd.d.mts} +0 -0
- /package/dist/{log-BdD_Fpms.mjs → log-ChfPKsVd.mjs} +0 -0
- /package/dist/{pathe.M-eThtNZ-BrPhGF_K.mjs → pathe.M-eThtNZ-CQzLbt4c.mjs} +0 -0
- /package/dist/{pg-CempqvEJ.mjs → pg-J2HbZIkX.mjs} +0 -0
- /package/dist/{providers-BJIoduK9.d.mts → providers-BNKRacMr.d.mts} +0 -0
- /package/dist/{providers-BwPbdHdi.mjs → providers-CJlNS3kT.mjs} +0 -0
- /package/dist/{proxy-M3pxItg2.mjs → proxy-D-3_D-Gl.mjs} +0 -0
- /package/dist/{chunk-DJd-R1mw.mjs → rolldown-runtime-DJK8HYOj.mjs} +0 -0
- /package/dist/{standard-schema-Cy0lfeWv.d.mts → standard-schema-DJ0HW7QP.d.mts} +0 -0
- /package/dist/{types-BodZGegX.d.mts → types-lLjNE9Qp.d.mts} +0 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## Example
|
|
6
6
|
|
|
7
|
-
```ts
|
|
7
|
+
```ts [vite.config.ts]
|
|
8
8
|
import { defineConfig } from 'vite-plus';
|
|
9
9
|
|
|
10
10
|
export default defineConfig({
|
|
@@ -16,3 +16,5 @@ export default defineConfig({
|
|
|
16
16
|
},
|
|
17
17
|
});
|
|
18
18
|
```
|
|
19
|
+
|
|
20
|
+
For package-specific formatting settings in a workspace, use [`fmt.overrides`](/guide/monorepo#format-overrides) from the root `vite.config.ts`.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Vite+ keeps project configuration in one place: `vite.config.ts`, allowing you to consolidate many top-level configuration files in a single file. You can keep using your Vite configuration such as `server` or `build`, and add Vite+ blocks for the rest of your workflow:
|
|
4
4
|
|
|
5
|
-
```ts
|
|
5
|
+
```ts [vite.config.ts]
|
|
6
6
|
import { defineConfig } from 'vite-plus';
|
|
7
7
|
|
|
8
8
|
export default defineConfig({
|
|
@@ -10,10 +10,12 @@ export default defineConfig({
|
|
|
10
10
|
build: {},
|
|
11
11
|
preview: {},
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
lint: {},
|
|
15
|
-
fmt: {},
|
|
13
|
+
create: {},
|
|
16
14
|
run: {},
|
|
15
|
+
fmt: {},
|
|
16
|
+
lint: {},
|
|
17
|
+
check: {},
|
|
18
|
+
test: {},
|
|
17
19
|
pack: {},
|
|
18
20
|
staged: {},
|
|
19
21
|
});
|
|
@@ -23,9 +25,11 @@ export default defineConfig({
|
|
|
23
25
|
|
|
24
26
|
Vite+ extends the basic Vite configuration with these additions:
|
|
25
27
|
|
|
26
|
-
- [`
|
|
28
|
+
- [`create`](/config/create) for project and template scaffolding defaults
|
|
29
|
+
- [`run`](/config/run) for Vite Task
|
|
27
30
|
- [`fmt`](/config/fmt) for Oxfmt
|
|
31
|
+
- [`lint`](/config/lint) for Oxlint
|
|
32
|
+
- [`check`](/config/check) for `vp check` defaults
|
|
28
33
|
- [`test`](/config/test) for Vitest
|
|
29
|
-
- [`run`](/config/run) for Vite Task
|
|
30
34
|
- [`pack`](/config/pack) for tsdown
|
|
31
|
-
- [`staged`](/config/staged) for staged-file checks
|
|
35
|
+
- [`staged`](/config/staged) for staged-file checks
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## Example
|
|
6
6
|
|
|
7
|
-
```ts
|
|
7
|
+
```ts [vite.config.ts]
|
|
8
8
|
import { defineConfig } from 'vite-plus';
|
|
9
9
|
|
|
10
10
|
export default defineConfig({
|
|
@@ -22,3 +22,5 @@ export default defineConfig({
|
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
We recommend enabling both `options.typeAware` and `options.typeCheck` so `vp lint` and `vp check` can use the full type-aware path.
|
|
25
|
+
|
|
26
|
+
For package-specific lint rules in a workspace, use [`lint.overrides`](/guide/monorepo#root-config-with-overrides) from the root `vite.config.ts`.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
You can configure Vite Task under the `run` field in `vite.config.ts`. Check out [`vp run`](/guide/run) to learn more about running scripts and tasks with Vite+.
|
|
4
4
|
|
|
5
|
-
```ts
|
|
5
|
+
```ts [vite.config.ts]
|
|
6
6
|
import { defineConfig } from 'vite-plus';
|
|
7
7
|
|
|
8
8
|
export default defineConfig({
|
|
@@ -27,7 +27,7 @@ Whether to automatically run `preX`/`postX` package.json scripts as lifecycle ho
|
|
|
27
27
|
|
|
28
28
|
When enabled (the default), running a script like `test` will automatically run `pretest` before it and `posttest` after it, if they exist in `package.json`.
|
|
29
29
|
|
|
30
|
-
```ts
|
|
30
|
+
```ts [vite.config.ts]
|
|
31
31
|
export default defineConfig({
|
|
32
32
|
run: {
|
|
33
33
|
enablePrePostScripts: false, // Disable pre/post lifecycle hooks
|
|
@@ -46,7 +46,7 @@ This option can only be set in the workspace root's `vite.config.ts`. Setting it
|
|
|
46
46
|
|
|
47
47
|
Controls whether task results are cached and replayed on subsequent runs.
|
|
48
48
|
|
|
49
|
-
```ts
|
|
49
|
+
```ts [vite.config.ts]
|
|
50
50
|
export default defineConfig({
|
|
51
51
|
run: {
|
|
52
52
|
cache: {
|
|
@@ -61,17 +61,37 @@ export default defineConfig({
|
|
|
61
61
|
|
|
62
62
|
## `run.tasks`
|
|
63
63
|
|
|
64
|
-
- **Type:** `Record<string,
|
|
64
|
+
- **Type:** `Record<string, Task | string | string[]>`
|
|
65
65
|
|
|
66
66
|
Defines tasks that can be run with `vp run <task>`.
|
|
67
67
|
|
|
68
|
+
As a shorthand, a task value can be a command string or an array of command strings directly:
|
|
69
|
+
|
|
70
|
+
```ts [vite.config.ts]
|
|
71
|
+
tasks: {
|
|
72
|
+
build: 'vp build',
|
|
73
|
+
check: ['vp lint', 'vp build'],
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
These are equivalent to setting only `command` on a task config:
|
|
78
|
+
|
|
79
|
+
```ts [vite.config.ts]
|
|
80
|
+
tasks: {
|
|
81
|
+
build: { command: 'vp build' },
|
|
82
|
+
check: { command: ['vp lint', 'vp build'] },
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Use the object form when a task needs other fields like `cache`, `dependsOn`, `env`, or `input`.
|
|
87
|
+
|
|
68
88
|
### `command`
|
|
69
89
|
|
|
70
|
-
- **Type:** `string`
|
|
90
|
+
- **Type:** `string | string[]`
|
|
71
91
|
|
|
72
|
-
Defines the shell command to run for the task.
|
|
92
|
+
Defines the shell command to run for the task. The string is interpreted by a shell, so spaces, quoting, `&&`, pipes, and redirects all work as written on the command line.
|
|
73
93
|
|
|
74
|
-
```ts
|
|
94
|
+
```ts [vite.config.ts]
|
|
75
95
|
tasks: {
|
|
76
96
|
build: {
|
|
77
97
|
command: 'vp build',
|
|
@@ -79,18 +99,35 @@ tasks: {
|
|
|
79
99
|
}
|
|
80
100
|
```
|
|
81
101
|
|
|
102
|
+
An array runs each entry as its own command, sequentially, equivalent to joining them with `&&`. It is **not** a way to split one command into argv tokens — `['vp', 'build']` would try to run a command called `vp` with no arguments, then a command called `build`, instead of `vp build`.
|
|
103
|
+
|
|
104
|
+
```ts [vite.config.ts]
|
|
105
|
+
tasks: {
|
|
106
|
+
check: {
|
|
107
|
+
// Two commands, run in order
|
|
108
|
+
command: ['vp lint', 'vp build'],
|
|
109
|
+
},
|
|
110
|
+
bad: {
|
|
111
|
+
// Wrong: this is NOT `vp build`; it is `vp` followed by `build`
|
|
112
|
+
command: ['vp', 'build'],
|
|
113
|
+
},
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
82
117
|
Each task defined in `vite.config.ts` must include its own `command`. You cannot define a task in both `vite.config.ts` and `package.json` with the same task name.
|
|
83
118
|
|
|
84
|
-
Commands joined with `&&` are automatically split into independently cached sub-tasks. See [Compound Commands](/guide/run#compound-commands).
|
|
119
|
+
Commands joined with `&&` (or supplied as an array) are automatically split into independently cached sub-tasks. See [Compound Commands](/guide/run#compound-commands).
|
|
85
120
|
|
|
86
121
|
### `dependsOn`
|
|
87
122
|
|
|
88
|
-
- **Type:** `string
|
|
123
|
+
- **Type:** `Array<string | { task: string, from: DependsOnFrom }>`
|
|
89
124
|
- **Default:** `[]`
|
|
90
125
|
|
|
126
|
+
`from` accepts the dependency types `"dependencies"`, `"devDependencies"`, `"peerDependencies"`, or an array of those values, such as `["dependencies", "devDependencies"]`.
|
|
127
|
+
|
|
91
128
|
Tasks that must complete successfully before this one starts.
|
|
92
129
|
|
|
93
|
-
```ts
|
|
130
|
+
```ts [vite.config.ts]
|
|
94
131
|
tasks: {
|
|
95
132
|
deploy: {
|
|
96
133
|
command: 'deploy-script --prod',
|
|
@@ -101,10 +138,23 @@ tasks: {
|
|
|
101
138
|
|
|
102
139
|
Dependencies can reference tasks in other packages using the `package#task` format:
|
|
103
140
|
|
|
104
|
-
```ts
|
|
141
|
+
```ts [vite.config.ts]
|
|
105
142
|
dependsOn: ['@my/core#build', '@my/utils#lint'];
|
|
106
143
|
```
|
|
107
144
|
|
|
145
|
+
Use the object form `{ task: string, from: DependsOnFrom }` to reference tasks from all dependencies:
|
|
146
|
+
|
|
147
|
+
```ts [vite.config.ts]
|
|
148
|
+
tasks: {
|
|
149
|
+
test: {
|
|
150
|
+
command: 'vp test',
|
|
151
|
+
dependsOn: [{ task: 'build', from: ['dependencies', 'devDependencies'] }],
|
|
152
|
+
},
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
For the example above, Vite Task reads the declaring package's direct `dependencies` and `devDependencies`, and runs the `build` task in each dependency that defines one. Packages without `build` are skipped.
|
|
157
|
+
|
|
108
158
|
See [Task Dependencies](/guide/run#task-dependencies) for details on how explicit and topological dependencies interact.
|
|
109
159
|
|
|
110
160
|
### `cache`
|
|
@@ -114,7 +164,7 @@ See [Task Dependencies](/guide/run#task-dependencies) for details on how explici
|
|
|
114
164
|
|
|
115
165
|
Whether to cache this task's output. Set to `false` for tasks that should never be cached, like dev servers:
|
|
116
166
|
|
|
117
|
-
```ts
|
|
167
|
+
```ts [vite.config.ts]
|
|
118
168
|
tasks: {
|
|
119
169
|
dev: {
|
|
120
170
|
command: 'vp dev',
|
|
@@ -130,20 +180,22 @@ tasks: {
|
|
|
130
180
|
|
|
131
181
|
Environment variables included in the cache fingerprint. When any listed variable's value changes, the cache is invalidated.
|
|
132
182
|
|
|
133
|
-
```ts
|
|
183
|
+
```ts [vite.config.ts]
|
|
134
184
|
tasks: {
|
|
135
185
|
build: {
|
|
136
|
-
command: '
|
|
186
|
+
command: 'node build.mjs',
|
|
137
187
|
env: ['NODE_ENV'],
|
|
138
188
|
},
|
|
139
189
|
}
|
|
140
190
|
```
|
|
141
191
|
|
|
142
|
-
Wildcard patterns are supported: `VITE_*` matches all variables starting with `VITE_
|
|
192
|
+
Wildcard patterns and `!` exclusion patterns are supported: `VITE_*` matches all variables starting with `VITE_`, and `!VITE_SECRET` excludes the `VITE_SECRET` variable from the match.
|
|
193
|
+
|
|
194
|
+
For `vp build`, Vite reports Vite environment variables through [automatic tracking](/guide/automatic-data-tracking#cooperative-tracking). Do not add `VITE_*` or `NODE_ENV` here for a standard Vite build unless your project has extra build behavior Vite cannot report.
|
|
143
195
|
|
|
144
196
|
```bash
|
|
145
197
|
$ NODE_ENV=development vp run build # first run
|
|
146
|
-
$ NODE_ENV=production vp run build # cache miss:
|
|
198
|
+
$ NODE_ENV=production vp run build # cache miss: env 'NODE_ENV' changed
|
|
147
199
|
```
|
|
148
200
|
|
|
149
201
|
### `untrackedEnv`
|
|
@@ -153,32 +205,36 @@ $ NODE_ENV=production vp run build # cache miss: variable changed
|
|
|
153
205
|
|
|
154
206
|
Environment variables passed to the task process but **not** included in the cache fingerprint. Changing these values won't invalidate the cache.
|
|
155
207
|
|
|
156
|
-
```ts
|
|
208
|
+
```ts [vite.config.ts]
|
|
157
209
|
tasks: {
|
|
158
210
|
build: {
|
|
159
|
-
command: '
|
|
211
|
+
command: 'node build.mjs',
|
|
160
212
|
untrackedEnv: ['CI', 'GITHUB_ACTIONS'],
|
|
161
213
|
},
|
|
162
214
|
}
|
|
163
215
|
```
|
|
164
216
|
|
|
165
|
-
|
|
217
|
+
`untrackedEnv` accepts the same wildcard and `!` exclusion patterns as [`env`](#env).
|
|
218
|
+
|
|
219
|
+
Do not put a variable in `untrackedEnv` if its value changes the task result. If a cache-reporting tool covers the variable through [automatic tracking](/guide/automatic-data-tracking#cooperative-tracking), leave it out of both `env` and `untrackedEnv`.
|
|
220
|
+
|
|
221
|
+
Vite Task passes a set of common environment variables to all tasks:
|
|
166
222
|
|
|
167
223
|
- **System:** `HOME`, `USER`, `PATH`, `SHELL`, `LANG`, `TZ`
|
|
168
224
|
- **Node.js:** `NODE_OPTIONS`, `COREPACK_HOME`, `PNPM_HOME`
|
|
169
225
|
- **CI/CD:** `CI`, `VERCEL_*`, `NEXT_*`
|
|
170
|
-
- **Terminal:** `
|
|
226
|
+
- **Terminal:** Color variables (`FORCE_COLOR`, `NO_COLOR`, `COLORTERM`, `TERM`, `TERM_PROGRAM`) aren't passed to tasks unless you list them under `env` (the value gets fingerprinted, so changing it invalidates the cache) or `untrackedEnv` (passed without fingerprinting). If `FORCE_COLOR` isn't in either list, the child gets `FORCE_COLOR=1` so cached logs stay colored. Colors get stripped on display when the terminal can't render them.
|
|
171
227
|
|
|
172
228
|
### `input`
|
|
173
229
|
|
|
174
230
|
- **Type:** `Array<string | { auto: boolean } | { pattern: string, base: "workspace" | "package" }>`
|
|
175
231
|
- **Default:** `[{ auto: true }]` (auto-inferred)
|
|
176
232
|
|
|
177
|
-
Vite Task automatically detects which files
|
|
233
|
+
Vite Task automatically detects which files a command uses. See [Automatic Data Tracking](/guide/automatic-data-tracking) for the details and when to add manual config.
|
|
178
234
|
|
|
179
235
|
**Exclude files** from automatic tracking:
|
|
180
236
|
|
|
181
|
-
```ts
|
|
237
|
+
```ts [vite.config.ts]
|
|
182
238
|
tasks: {
|
|
183
239
|
build: {
|
|
184
240
|
command: 'vp build',
|
|
@@ -190,7 +246,7 @@ tasks: {
|
|
|
190
246
|
|
|
191
247
|
**Specify explicit files** only without automatic tracking:
|
|
192
248
|
|
|
193
|
-
```ts
|
|
249
|
+
```ts [vite.config.ts]
|
|
194
250
|
tasks: {
|
|
195
251
|
build: {
|
|
196
252
|
command: 'vp build',
|
|
@@ -201,7 +257,7 @@ tasks: {
|
|
|
201
257
|
|
|
202
258
|
**Resolve patterns relative to the workspace root** using the object form:
|
|
203
259
|
|
|
204
|
-
```ts
|
|
260
|
+
```ts [vite.config.ts]
|
|
205
261
|
tasks: {
|
|
206
262
|
build: {
|
|
207
263
|
command: 'vp build',
|
|
@@ -214,12 +270,13 @@ tasks: {
|
|
|
214
270
|
```
|
|
215
271
|
|
|
216
272
|
The `base` field is required and controls how the glob pattern is resolved:
|
|
273
|
+
|
|
217
274
|
- `"package"`: relative to the package directory
|
|
218
275
|
- `"workspace"`: relative to the workspace root
|
|
219
276
|
|
|
220
277
|
**Disable file tracking** entirely and cache only on command/env changes:
|
|
221
278
|
|
|
222
|
-
```ts
|
|
279
|
+
```ts [vite.config.ts]
|
|
223
280
|
tasks: {
|
|
224
281
|
greet: {
|
|
225
282
|
command: 'node greet.mjs',
|
|
@@ -232,6 +289,64 @@ tasks: {
|
|
|
232
289
|
String glob patterns are resolved relative to the package directory by default. Use the object form with `base: "workspace"` to resolve relative to the workspace root.
|
|
233
290
|
:::
|
|
234
291
|
|
|
292
|
+
### `output`
|
|
293
|
+
|
|
294
|
+
- **Type:** `Array<string | { auto: boolean } | { pattern: string, base: "workspace" | "package" }>`
|
|
295
|
+
- **Default:** automatic write tracking
|
|
296
|
+
|
|
297
|
+
Vite Task automatically archives files generated by a successful task run and restores them on a cache hit.
|
|
298
|
+
|
|
299
|
+
If you omit `output`, Vite Task uses automatic write tracking to choose those files. Add explicit `output` entries when you need to override which files are restored.
|
|
300
|
+
|
|
301
|
+
```ts [vite.config.ts]
|
|
302
|
+
tasks: {
|
|
303
|
+
build: {
|
|
304
|
+
command: 'node build.mjs',
|
|
305
|
+
output: ['dist/**', '!dist/cache/**'],
|
|
306
|
+
},
|
|
307
|
+
}
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
Use `{ auto: true }` to keep automatic write tracking while adding explicit output globs.
|
|
311
|
+
|
|
312
|
+
This is useful when a task writes files that should not be restored from the cache. For example, exclude TypeScript `.tsbuildinfo` files:
|
|
313
|
+
|
|
314
|
+
```ts [vite.config.ts]
|
|
315
|
+
tasks: {
|
|
316
|
+
typecheck: {
|
|
317
|
+
command: 'tsc --build',
|
|
318
|
+
output: [{ auto: true }, '!*.tsbuildinfo'],
|
|
319
|
+
},
|
|
320
|
+
}
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
If a task writes outside its own package, use the object form with `base: "workspace"`:
|
|
324
|
+
|
|
325
|
+
```ts [vite.config.ts]
|
|
326
|
+
tasks: {
|
|
327
|
+
build: {
|
|
328
|
+
command: 'node build.mjs',
|
|
329
|
+
output: [
|
|
330
|
+
'dist/**',
|
|
331
|
+
{ pattern: 'shared-artifacts/**', base: 'workspace' },
|
|
332
|
+
],
|
|
333
|
+
},
|
|
334
|
+
}
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
Set `output: []` to disable output restoration for a cached task:
|
|
338
|
+
|
|
339
|
+
```ts [vite.config.ts]
|
|
340
|
+
tasks: {
|
|
341
|
+
report: {
|
|
342
|
+
command: 'node scripts/report.mjs',
|
|
343
|
+
output: [],
|
|
344
|
+
},
|
|
345
|
+
}
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
Unlike `cache: false`, `output: []` still lets Vite Task fingerprint the task. On a cache hit, Vite Task skips the command and replays its terminal output. Use this for local caches when the task's output files are already there and do not need to be restored.
|
|
349
|
+
|
|
235
350
|
### `cwd`
|
|
236
351
|
|
|
237
352
|
- **Type:** `string`
|
|
@@ -239,7 +354,7 @@ String glob patterns are resolved relative to the package directory by default.
|
|
|
239
354
|
|
|
240
355
|
Working directory for the task, relative to the package root.
|
|
241
356
|
|
|
242
|
-
```ts
|
|
357
|
+
```ts [vite.config.ts]
|
|
243
358
|
tasks: {
|
|
244
359
|
'test-e2e': {
|
|
245
360
|
command: 'vp test',
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# Automatic Data Tracking
|
|
2
|
+
|
|
3
|
+
Automatic data tracking is how Vite Task learns what inputs a task needs for caching outputs without explicit config.
|
|
4
|
+
|
|
5
|
+
When you run a cache-enabled task, Vite Task observes the task's execution and records what files were read and written, as well as any metadata reported by the task. On the next run, Vite Task uses the recorded fingerprint to decide whether to replay the cache or run the task.
|
|
6
|
+
|
|
7
|
+
Use this page when you need to understand why a task hits or misses the cache, or when you need to decide whether to add `input`, `output`, `env`, or `untrackedEnv` config.
|
|
8
|
+
|
|
9
|
+
## Tracking Tiers
|
|
10
|
+
|
|
11
|
+
Automatic data tracking has two tiers:
|
|
12
|
+
|
|
13
|
+
| Tier | Applies to | Records |
|
|
14
|
+
| -------------------- | ---------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
15
|
+
| File system tracking | All tasks with cache enabled | <ul><li>Files read by the command</li><li>Missing-file probes</li><li>Directory listings</li><li>Written output files</li></ul> |
|
|
16
|
+
| Cooperative tracking | Cache-reporting tools (`vp build` today) | <ul><li>Environment variables reported by the tool</li><li>Tool-managed paths that should not be inputs or outputs, such as `node_modules/.vite-temp`</li></ul> |
|
|
17
|
+
|
|
18
|
+
Vite Task starts with file system tracking for any command. A cache-reporting tool can add information that only the tool knows while it runs.
|
|
19
|
+
|
|
20
|
+
## File System Tracking
|
|
21
|
+
|
|
22
|
+
File system tracking applies to every cache-enabled task. If you omit [`input`](/config/run#input), Vite Task tracks the files a command reads while it runs:
|
|
23
|
+
|
|
24
|
+
```ts [vite.config.ts]
|
|
25
|
+
import { defineConfig } from 'vite-plus';
|
|
26
|
+
|
|
27
|
+
export default defineConfig({
|
|
28
|
+
run: {
|
|
29
|
+
tasks: {
|
|
30
|
+
build: {
|
|
31
|
+
command: 'tsc',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
For this task, Vite Task records source files, config files, missing files the command checked, and directories the command scanned. Subsequent runs re-run the task when one of those tracked inputs changes.
|
|
39
|
+
|
|
40
|
+
File system tracking also tracks outputs. If you omit [`output`](/config/run#output), Vite Task archives files the command writes after a successful run and restores them on a cache hit.
|
|
41
|
+
|
|
42
|
+
### Limitations
|
|
43
|
+
|
|
44
|
+
Vite Task cannot track environment variable reads, and it cannot always tell which tracked paths are stable inputs, generated outputs, or tool-managed cache paths that should not become inputs or outputs.
|
|
45
|
+
|
|
46
|
+
Use [Override Inputs And Outputs](#override-inputs-and-outputs) when file system tracking includes files that should not affect the cache, misses files that should, or restores the wrong outputs.
|
|
47
|
+
|
|
48
|
+
Use [`env`](/config/run#env) when a command needs an environment variable and the value should affect the cache, or [`untrackedEnv`](/config/run#untrackedenv) when the value should not affect the cache.
|
|
49
|
+
|
|
50
|
+
These limitations do not apply to `vp build`: Vite reports [Cooperative Tracking](#cooperative-tracking) metadata automatically, including `VITE_*`, `NODE_ENV`, and Vite-managed cache paths that should not become inputs or outputs. A standard `vp build` task does not need manual `input`, `output`, or `env`.
|
|
51
|
+
|
|
52
|
+
### Override Inputs And Outputs
|
|
53
|
+
|
|
54
|
+
[`input`](/config/run#input) controls what invalidates the cache. [`output`](/config/run#output) controls which files Vite Task restores on a cache hit.
|
|
55
|
+
|
|
56
|
+
Both options use the same syntax and can be configured separately.
|
|
57
|
+
|
|
58
|
+
- Omit the option to keep automatic tracking.
|
|
59
|
+
- Add `{ auto: true }` to keep automatic tracking while adding glob rules.
|
|
60
|
+
- Use string globs to include paths.
|
|
61
|
+
- Use `!` globs to exclude paths.
|
|
62
|
+
- Use `[]` to replace automatic tracking with an empty list.
|
|
63
|
+
|
|
64
|
+
```ts [vite.config.ts]
|
|
65
|
+
tasks: {
|
|
66
|
+
build: {
|
|
67
|
+
command: 'node build.mjs',
|
|
68
|
+
|
|
69
|
+
// Keep automatic input tracking, but exclude `dist` from inputs.
|
|
70
|
+
input: [{ auto: true }, '!dist/**'],
|
|
71
|
+
|
|
72
|
+
// Disable automatic output tracking and restore only `dist/**` on a cache hit.
|
|
73
|
+
output: ['dist/**'],
|
|
74
|
+
},
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Use explicit `input` globs only when you know the command's full input set. This lint task overrides inputs only, so output tracking stays automatic:
|
|
79
|
+
|
|
80
|
+
```ts [vite.config.ts]
|
|
81
|
+
tasks: {
|
|
82
|
+
lint: {
|
|
83
|
+
command: 'vp lint',
|
|
84
|
+
// Disable automatic input tracking and fingerprint only these files.
|
|
85
|
+
input: ['src/**', 'vite.config.ts'],
|
|
86
|
+
},
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Set `input: []` when no files should affect the cache fingerprint. This is rarely useful. For example, a download task can be cached when the same URL always serves the same file. No input files should be fingerprinted for this task, but changing the URL still invalidates the cache:
|
|
91
|
+
|
|
92
|
+
```ts [vite.config.ts]
|
|
93
|
+
tasks: {
|
|
94
|
+
downloadSchema: {
|
|
95
|
+
command: 'curl -O https://example.com/schema.json',
|
|
96
|
+
input: [],
|
|
97
|
+
},
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Set `output: []` when no files should be restored on a cache hit.
|
|
102
|
+
|
|
103
|
+
## Cooperative Tracking
|
|
104
|
+
|
|
105
|
+
File system tracking records access. It cannot know why a tool used each path.
|
|
106
|
+
|
|
107
|
+
`vp build` knows more about a Vite build than Vite Task can infer from file access. When `vp build` runs with cache enabled, Vite reports that metadata to Vite Task. Vite Task merges the report with file system tracking to build a more accurate cache fingerprint.
|
|
108
|
+
|
|
109
|
+
For a standard Vite build, you do not need to add these entries yourself because Vite reports them automatically at runtime:
|
|
110
|
+
|
|
111
|
+
- `env: ['VITE_*']` or `env: ['NODE_ENV']`
|
|
112
|
+
- `output: ['dist/**']`
|
|
113
|
+
- input or output exclusions for temporary paths like `node_modules/.vite-temp`
|
|
114
|
+
|
|
115
|
+
You only need to define the task with `vp build`:
|
|
116
|
+
|
|
117
|
+
```ts [vite.config.ts]
|
|
118
|
+
import { defineConfig } from 'vite-plus';
|
|
119
|
+
|
|
120
|
+
export default defineConfig({
|
|
121
|
+
run: {
|
|
122
|
+
tasks: {
|
|
123
|
+
frontendBuild: 'vp build',
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Run this task with `vpr frontendBuild` or `vp run frontendBuild`.
|
|
130
|
+
|
|
131
|
+
Manual config overrides reported metadata. Add `input`, `output`, `env`, or `untrackedEnv` when your project has behavior that Vite cannot report.
|
|
132
|
+
|
|
133
|
+
Vite+ supports cooperative tracking for `vp build` today. It will extend this support to more first-party tools in the future. Third-party tools can report cache metadata with [`@voidzero-dev/vite-task-client`](https://npmx.dev/package/@voidzero-dev/vite-task-client).
|
|
134
|
+
|
|
135
|
+
## When To Add Manual Config
|
|
136
|
+
|
|
137
|
+
Add config when your project has behavior the command or tool cannot know.
|
|
138
|
+
|
|
139
|
+
| Case | Example |
|
|
140
|
+
| ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
|
|
141
|
+
| Exclude an output directory from inputs | `input: [{ auto: true }, '!dist/**']` |
|
|
142
|
+
| Exclude a temporary generated file from input and output tracking | `input: [{ auto: true }, '!.tmp/config.mjs']`<br>`output: [{ auto: true }, '!.tmp/config.mjs']` |
|
|
143
|
+
| Avoid automatic file tracking for a task | `input: ['src/**']`<br>`output: ['dist/**']` |
|
|
144
|
+
| Track and pass an env var | `env: ['NODE_ENV']` |
|
|
145
|
+
| Pass an env var without fingerprinting it | `untrackedEnv: ['GITHUB_ACTIONS']` |
|
|
@@ -4,23 +4,19 @@ Vite Task can automatically track dependencies and cache tasks run through `vp r
|
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
When a task runs successfully (exit code 0), its terminal output (stdout/stderr)
|
|
7
|
+
When a task runs successfully (exit code 0), its terminal output (stdout/stderr) and all written files (output files) are saved. On the next run, Vite Task checks if anything changed:
|
|
8
8
|
|
|
9
9
|
1. **Arguments:** did the [additional arguments](/guide/run#additional-arguments) passed to the task change?
|
|
10
10
|
2. **Environment variables:** did any [fingerprinted env vars](/config/run#env) change?
|
|
11
|
-
3. **
|
|
11
|
+
3. **Inputs:** did any input file that the command reads change?
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
::: info
|
|
16
|
-
Currently, only terminal output is cached and replayed. Output files such as `dist/` are not cached. If you delete them, use `--no-cache` to force a re-run. Output file caching is planned for a future release.
|
|
17
|
-
:::
|
|
13
|
+
When all checks match, Vite Task replays the cached terminal output, restores saved output files, and skips the command.
|
|
18
14
|
|
|
19
15
|
When a cache miss occurs, Vite Task tells you exactly why:
|
|
20
16
|
|
|
21
17
|
```
|
|
22
18
|
$ vp lint ✗ cache miss: 'src/utils.ts' modified, executing
|
|
23
|
-
$ vp build ✗ cache miss: env changed, executing
|
|
19
|
+
$ vp build ✗ cache miss: env 'VITE_GREETING' changed, executing
|
|
24
20
|
$ vp test ✗ cache miss: args changed, executing
|
|
25
21
|
```
|
|
26
22
|
|
|
@@ -36,7 +32,7 @@ A task can set [`cache: false`](/config/run#cache) to opt out. This cannot be ov
|
|
|
36
32
|
|
|
37
33
|
### 2. CLI flags
|
|
38
34
|
|
|
39
|
-
`--no-cache` disables caching for
|
|
35
|
+
`--no-cache` disables caching for every task and script in that run. `--cache` enables caching for both tasks and scripts, which is equivalent to setting [`run.cache: true`](/config/run#run-cache) for that invocation.
|
|
40
36
|
|
|
41
37
|
### 3. Workspace config
|
|
42
38
|
|
|
@@ -47,29 +43,21 @@ The [`run.cache`](/config/run#run-cache) option in your root `vite.config.ts` co
|
|
|
47
43
|
| `cache.tasks` | `true` | Cache tasks defined in `vite.config.ts` |
|
|
48
44
|
| `cache.scripts` | `false` | Cache `package.json` scripts |
|
|
49
45
|
|
|
50
|
-
## Automatic
|
|
51
|
-
|
|
52
|
-
Vite Task tracks which files each command reads during execution. When a task runs, it records which files the process opens, such as your `.ts` source files, `vite.config.ts`, and `package.json`, and records their content hashes. On the next run, it re-checks those hashes to determine if anything changed.
|
|
53
|
-
|
|
54
|
-
This means caching works out of the box for most commands without any configuration. Vite Task also records:
|
|
55
|
-
|
|
56
|
-
- **Missing files:** if a command probes for a file that doesn't exist, such as `utils.ts` during module resolution, creating that file later correctly invalidates the cache.
|
|
57
|
-
- **Directory listings:** if a command scans a directory, such as a test runner looking for `*.test.ts`, adding or removing files in that directory invalidates the cache.
|
|
58
|
-
|
|
59
|
-
### Avoiding Overly Broad Input Tracking
|
|
46
|
+
## Automatic Data Tracking
|
|
60
47
|
|
|
61
|
-
|
|
48
|
+
Vite Task uses [automatic data tracking](/guide/automatic-data-tracking) to learn what each task needs for caching so you don't have to configure it manually. Automatic data tracking has two tiers:
|
|
62
49
|
|
|
63
|
-
- **
|
|
64
|
-
- **
|
|
50
|
+
- **File system tracking:** Vite Task records file reads, missing-file probes, directory listings, and written output files for every task with cache enabled.
|
|
51
|
+
- **Cooperative tracking:** cache-reporting tools can report metadata that file system tracking cannot infer. Vite+ supports this for `vp build` today.
|
|
65
52
|
|
|
66
|
-
Use
|
|
53
|
+
Use [`input`](/config/run#input) or [`output`](/config/run#output) when a task needs manual tracking rules. `input` controls what invalidates the cache. `output` controls which files Vite Task restores on a cache hit.
|
|
67
54
|
|
|
68
|
-
```ts
|
|
55
|
+
```ts [vite.config.ts]
|
|
69
56
|
tasks: {
|
|
70
57
|
build: {
|
|
71
|
-
command: '
|
|
72
|
-
input: [{ auto: true }, '
|
|
58
|
+
command: 'node build.mjs',
|
|
59
|
+
input: [{ auto: true }, '!dist/**'],
|
|
60
|
+
output: ['dist/**'],
|
|
73
61
|
},
|
|
74
62
|
}
|
|
75
63
|
```
|
|
@@ -80,7 +68,7 @@ By default, tasks run in a clean environment. Only a small set of common variabl
|
|
|
80
68
|
|
|
81
69
|
To add an environment variable to the cache key, add it to [`env`](/config/run#env). Changing its value then invalidates the cache:
|
|
82
70
|
|
|
83
|
-
```ts
|
|
71
|
+
```ts [vite.config.ts]
|
|
84
72
|
tasks: {
|
|
85
73
|
build: {
|
|
86
74
|
command: 'webpack --mode production',
|
|
@@ -89,7 +77,7 @@ tasks: {
|
|
|
89
77
|
}
|
|
90
78
|
```
|
|
91
79
|
|
|
92
|
-
To pass a variable to the task **without** affecting cache behavior, use [`untrackedEnv`](/config/run#
|
|
80
|
+
To pass a variable to the task **without** affecting cache behavior, use [`untrackedEnv`](/config/run#untrackedenv). This is useful for variables like `CI` or `GITHUB_ACTIONS` that should be available in the task, but do not affect caching behavior.
|
|
93
81
|
|
|
94
82
|
See [Run Config](/config/run#env) for details on wildcard patterns and the full list of automatically passed-through variables.
|
|
95
83
|
|