Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.

fix(vite): don't copy publicDir files to _nuxt#2135

Merged
pi0 merged 3 commits intomainfrom
fix/vite-public
Nov 24, 2021
Merged

fix(vite): don't copy publicDir files to _nuxt#2135
pi0 merged 3 commits intomainfrom
fix/vite-public

Conversation

@danielroe
Copy link
Copy Markdown
Member

🔗 Linked issue

resolves nuxt/nuxt#12178

❓ 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

When building, vite copies publicDir contents and places them alongside assets in the _nuxt folder. This is an unwanted duplication of assets. (They will never be served from this path.) We can 'fix' this behaviour by simply not copying these files across to .output/public.

Ideally we would fix this with a PR to vite itself to allow us to allow js files to be included with assetsDir as well, rather than setting vite's base: '_nuxt', which seems like a workaround for our desired nuxt behaviour. (cc: @antfu)

📝 Checklist

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

@danielroe danielroe added bug Something isn't working vite labels Nov 24, 2021
@danielroe danielroe requested review from antfu and pi0 November 24, 2021 15:03
@danielroe danielroe self-assigned this Nov 24, 2021
@netlify
Copy link
Copy Markdown

netlify bot commented Nov 24, 2021

✔️ Deploy Preview for nuxt3-docs canceled.

🔨 Explore the source changes: 02ae04a

🔍 Inspect the deploy log: https://app.netlify.com/sites/nuxt3-docs/deploys/619e5d5d71c4600008bfe260

Comment thread packages/nitro/src/build.ts
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3.x bug Something isn't working vite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Building to .output is placing public files in 2 separate locations

2 participants