This repository was archived by the owner on Apr 6, 2023. It is now read-only.
fix(vite): don't prepend publicPath to public assets#2262
Closed
fix(vite): don't prepend publicPath to public assets#2262
Conversation
|
✔️ Deploy Preview for nuxt3-docs canceled. 🔨 Explore the source changes: 4f2188c 🔍 Inspect the deploy log: https://app.netlify.com/sites/nuxt3-docs/deploys/61b733306c25060007168dcf |
pi0
reviewed
Dec 13, 2021
| } | ||
| }, | ||
| base: nuxt.options.build.publicPath, | ||
| base: nuxt.options.dev ? nuxt.options.build.publicPath : nuxt.options.app.cdnURL || '/', |
Member
There was a problem hiding this comment.
Can we please not depend on CDN URL in vite config? CDN URL should not be considered in the app build step. It is mostly a deployment configuration. (what if we always default prod base to / ?)
Member
Author
|
@DrewLiberty Are you getting this behaviour with this PR? |
Haven't tried, how can I do it? it is not merged into main so a |
Contributor
How can we try it via npm? |
7 tasks
Member
|
Closing in the favor of #2655 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Linked issue
resolves nuxt/nuxt#12892
❓ Type of change
📚 Description
This PR sets base to be
/or cdnURL, if set (previously_nuxt), and setassetsDirinstead to_nuxt. This means we have the desired rewriting in the HTML for our assets: static assets aren't rewritten, but generated assets are. The only hack is that we then have to rewrite the client manifest to remove thisassetsDirprefix (because the bundle renderer will handle re-inserting it for us).Ideally we would have support in vite directly for this.
It produces a file structure like:
and in the HTML:
📝 Checklist
update bridge vite configuration too