Custom folder structure?
Hi!
Is there a way to modify folder structure in nuxt 3?
I mean, it looks really strange that server folder is located among multiple client-related folders
Would be nice to separate client and server logic completely by creating client folder where all vue stuff & other client-related code is
i found srcDir setting in nuxt.config.ts, but it also moves server folder: if i set , then i have to also move server folder to client/server , which is definitely not what i want
3 Replies
hey, coming in nuxt 4 is a new structure:
https://github.com/nuxt/nuxt/pull/27029
GitHub
feat(nuxt,schema): support v4 folder structure by danielroe · Pull ...
🔗 Linked issue
resolves #26444
📚 Description
This implements the new folder structure, if future.compatibilityVersion is set to 4 (which will be enabled by default when Nuxt v4 is released) - see #...
cool
but i think i found decent enough solution in nuxt 3:
at least this works for me for now
another way is define custom dir options in nuxt config
dir: {
public: '../public',
},
but to server config 'serverDir' must works fine , the 'server' options is not in 'dir' config i think