-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
public should be relative to the rootDir instead of srcDir #1209
Comments
and the comments (jsDoc), it is |
I found this updated and reverted. was there any side effect? |
WXT is inspired by Nuxt, and follows its conventions when it makes sense. Nuxt 3's Nuxt 4 plans on changing the One more thing worth noting is Nuxt also moved their So the real question is if we think the same justification Nuxt has for moving the I don't think it does, but I agree with you that it better aligns with the conventions across other frameworks... Which might be enough of a reason. If others vote to change this, it should be added to the upcoming 0.20 release. |
@2wheeh could you add links to other framework docs that indicate that the public directory is in the root directory by default? |
@aklinker1 I believe many users decide to use WXT since it is based on Vite. https://github.com/vitejs/vite/tree/main/packages/create-vite These are others that I've experienced locating public at the root: https://nextjs.org/docs/app/getting-started/project-structure hope this helps. |
No worries, I don't expect people to know that lol. Just providing context for further discussion. There was a conversation around this on discord. To summarize it's main points:
But since I'm the executive decision maker... I think we should change it to align with the convention. Even if it doesn't perfectly match the standard definition of a "public" directory, there's still lots of value in onboarding new developers by using familiar terms and concepts. So I'll add this to 0.20. |
This sounds sensible as well, though it would need some documentation. |
Late to the voting, but this was the first change I made when I started using WXT. |
Feature Request
Currently,
publicDir
is relative tosrcDir
, meaning whensrcDir
is set to'src'
, public files must be placed insrc/public
. This feels unintuitive since public assets typically live at the root level in most web projects.Having public assets in
src/
creates cognitive overhead since:Is your feature request related to a bug?
N/A
What are the alternatives?
Make
publicDir
relative torootDir
instead ofsrcDir
, allowing the public directory to be placed at root level (e.g.,<rootDir>/<publicDir>
) while source files are organized insrc/
.Additional context
This aligns with conventions from other popular web frameworks (Vue, React, Nextjs etc.) where public assets are typically placed at the root level for better project organization and clarity.
The text was updated successfully, but these errors were encountered: