-
-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Closed as not planned
Description
Description
When using build
programatically, publicDir
is enabled by default, that's, publicDir
will be applied.
I was talking with @patak-dev about this.
Suggested solution
Split build
adding a new variant or change the default publicDir
to false
.
Alternative
None: I'm preparing a PR to add a warning in the docs.
Additional context
For single builds there is no problem but using build
in secondary build processes (meta frameworks or Vite plugins) can lead in unexpected side effects, for example:
- fix: don't copy public folder when building custom sw vite-pwa/vite-plugin-pwa#525
- fix: don't copy public folder in service worker build sveltejs/kit#10082
- fix(pwa): pwa icons in dev and build elk-zone/elk#2137
In elk.zone repo, all public Nuxt 3 build assets were being overwritten after service worker build.
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.