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

fix(vite): set root to srcDir #1018

Merged
merged 1 commit into from
Oct 14, 2021
Merged

fix(vite): set root to srcDir #1018

merged 1 commit into from
Oct 14, 2021

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented Oct 14, 2021

🔗 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

Vite publicDir is set by default to <root>/public which fails with custom srcDir. This PR changes that root directory (though another valid fix would be to set publicDir directly if for some reason we want the root not to be at the same place as srcDir.

📝 Checklist

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

* resolves #1013
* resolves #988
@danielroe danielroe added bug Something isn't working vite labels Oct 14, 2021
@danielroe danielroe requested a review from antfu October 14, 2021 10:20
@danielroe danielroe self-assigned this Oct 14, 2021
@netlify
Copy link

netlify bot commented Oct 14, 2021

✔️ Deploy Preview for nuxt3-docs canceled.

🔨 Explore the source changes: dbc586f

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

@danielroe danielroe requested a review from pi0 October 14, 2021 10:50
@pi0
Copy link
Member

pi0 commented Oct 14, 2021

I think we need to deprecate srcDir usage instead.

@danielroe
Copy link
Member Author

@pi0 I'm a big fan of srcDir personally. What do you think is the issue with it?

@pi0
Copy link
Member

pi0 commented Oct 14, 2021

Same confusion that happens with vite and many of the nuxt modules honestly when we are not sure to use either srcDir or rootDir (vite has only one root!) But I guess it is to be discussed later on :) Hope this PR doesn't break anything else.

@pi0 pi0 merged commit b2c74d7 into main Oct 14, 2021
@pi0 pi0 deleted the fix/vite-rootdir branch October 14, 2021 11:17
@danielroe danielroe added the 3.x label Jan 19, 2023
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.

nuxt build cant find files Static files do not resolve
2 participants