Repository navigation
presets(vercel): support immutable static files - #4434
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
commit: |
# Conflicts: # test/presets/vercel.test.ts
- opt in via `NITRO_VERCEL_IMMUTABLE_STATIC_FILES_ENABLED`; `VERCEL_IMMUTABLE_STATIC_FILES_ENABLED` only signals platform support - skip with a warning on unsupported Vercel deployments and non-root `baseURL` - normalize `buildAssetsDir` (config + hash salt) - warn when no immutable assets were emitted - add unit tests
|
@danielroe heads up on the Nuxt side of this one. The branch is now synced with what landed on main in #4432.
(This comment was written with an AI assistant.) |
Run `setupImmutableStaticFiles` as a preset module instead of a `build:before` hook so frameworks that build the client before Nitro (Nuxt runs Vite before `build(nitro)`) can read `nitro.options.buildAssetsDir` from `nitro:init`.
… test real output - warn and skip when immutable static files were enabled after init - read `immutable.json` right after the vercel build and assert its contents with a fixture asset - clarify `buildAssetsDir` docs for v2 (frameworks apply it)
backport draft of #4432 for v2
undocumented and mainly for current nuxt v4 with manual integration with new
options.buildAssetsDir(config name might change)pending until #4432 lands, released and well-tested on real projects.
preview pkg for e2e testing:
{ "nitro": "https://pkg.pr.new/nitropack@4434" }