Repository navigation
set Vite's publicDir option - #5648
Conversation
🦋 Changeset detectedLatest commit: d63510b The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| // files in `static` | ||
| vite.middlewares.use(scoped(assets, mutable(config.kit.files.assets))); | ||
|
|
There was a problem hiding this comment.
we can get rid of this — it's covered by the next middleware now that we're using publicDir
| // files in `static` | |
| vite.middlewares.use(scoped(assets, mutable(config.kit.files.assets))); |
There was a problem hiding this comment.
after getting rid of this, there's only one occurrence of mutable (for prerendered dependencies), so perhaps we should inline the sirv call. though we might then need to ensure that prerendered/dependencies always exists, as I think sirv will barf otherwise
There was a problem hiding this comment.
I think it's nicely structured as a separate method. I took a look at inlining it locally and it doesn't feel quite as clean, so if it's all the same I'd probably just leave it as is
Co-authored-by: Rich Harris <[email protected]>
Co-authored-by: Rich Harris <[email protected]>
Trying 14c18e3 again, but in a way that will pass the CI this time
This sets the
publicDiroption, but still uses our ownsirvmiddleware to serve static assets. HavingpublicDirset though means that assets end up where expected for Vite plugins likevite-plugin-pwaand that they can find where we keep our assets