You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a user of Vite's Backend Integration, I do not want the manifest file to be generated in outDir since it does not need to be public.
Vite allows the path to be customised somewhat, but trying to generate it outside of outDir is not permitted (error: "The "fileName" or "name" properties of emitted chunks and assets must be strings that are neither absolute nor relative paths").
Suggested solution
Vite could permit relative/absolute paths in the build.manifest option, which are currently prohibited. This would have to be relative to build.outDir which I don't think is ideal but it at least enables this use case.
Alternately there could be a new option like build.manifestDir or allowing build.manifest to be an object with filename so that it is backwards compatible.
I don't think this is particularly helpful, I am writing a backend integration that is not concerned with running Vite itself (i.e. vite build is run separately).
Anyway, since that issue was closed the ability to customise the filename (but not the directory) was added.
Changing the package.jsonbuild script in every project using my backend integration to use "tsc -b && vite build && mv path/to/outDir/.vite/manifest.json somewhere/else/.vite/manifest.json"
This means needless duplication of the outDir from vite.config.ts.
Wrapping Vite using the JavaScript
For example, Remix moves the manifest file in this way since it's already running Vite for you. While powerful, this seems like too much effort to move a generated file to a non-public path. My backend integration is not in JS.
Description
As a user of Vite's Backend Integration, I do not want the manifest file to be generated in
outDir
since it does not need to be public.Vite allows the path to be customised somewhat, but trying to generate it outside of
outDir
is not permitted (error: "The "fileName" or "name" properties of emitted chunks and assets must be strings that are neither absolute nor relative paths").Suggested solution
Vite could permit relative/absolute paths in the
build.manifest
option, which are currently prohibited. This would have to be relative tobuild.outDir
which I don't think is ideal but it at least enables this use case.Alternately there could be a new option like
build.manifestDir
or allowingbuild.manifest
to be an object with filename so that it is backwards compatible.Alternative
It was suggested in build.manifest should be able to specify the target directory #2558 to "Just move it yourself after build."
I don't think this is particularly helpful, I am writing a backend integration that is not concerned with running Vite itself (i.e.
vite build
is run separately).Anyway, since that issue was closed the ability to customise the filename (but not the directory) was added.
Changing the
package.json
build
script in every project using my backend integration to use"tsc -b && vite build && mv path/to/outDir/.vite/manifest.json somewhere/else/.vite/manifest.json
"This means needless duplication of the
outDir
fromvite.config.ts
.Wrapping Vite using the JavaScript
For example, Remix moves the manifest file in this way since it's already running Vite for you. While powerful, this seems like too much effort to move a generated file to a non-public path. My backend integration is not in JS.
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: