-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <hello@rich-harris.dev>
Co-authored-by: Rich Harris <hello@rich-harris.dev>
Trying 14c18e3 again, but in a way that will pass the CI this time
This sets the
publicDir
option, but still uses our ownsirv
middleware to serve static assets. HavingpublicDir
set though means that assets end up where expected for Vite plugins likevite-plugin-pwa
and that they can find where we keep our assets