Skip to content
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

fix(build): publicAssets priority on build #819

Closed
wants to merge 1 commit into from
Closed

Conversation

antfu
Copy link
Member

@antfu antfu commented Jan 9, 2023

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

#817 was not a complete fix. As Vite will make an initial copy for the public file, ignoring overrides will instead keep the version from Vite's initial copy.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@antfu antfu requested a review from pi0 January 9, 2023 12:23
@pi0
Copy link
Member

pi0 commented Jan 9, 2023

I was going to suggest this method instead from previous PR but it was more performant by avoiding extra copy-override operations.

Is there a way to fix nuxt-vite behavior by not copying the assets? A quick workaround would be cleanup output/public just before starting copy but it had also benefit of supporting edge cases for custom override. So i prefer if fixing vite and otherwise cleanup with previous PR.

@antfu
Copy link
Member Author

antfu commented Jan 9, 2023

I think we could disable the public copy for Vite, but I am afraid it will affect how asset paths are resolved by Vite. Removing the public before copy might not work as Vite will merge the bundle and assets, which would be hard to identify.

I will do a bit more research to see if it's possible on Vite side.

@antfu
Copy link
Member Author

antfu commented Jan 9, 2023

It seems there is a copyPublicDir options introduced for SvelteKit, close in favor of nuxt/framework#10013

@antfu antfu closed this Jan 9, 2023
@pi0 pi0 deleted the fix/public-assets-2 branch January 9, 2023 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants