N
Nuxt6mo ago
ETFreeman

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
srcDir: 'client/'
srcDir: 'client/'
, then i have to also move server folder to client/server , which is definitely not what i want
3 Replies
Kyllian
Kyllian6mo ago
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 #...
ETFreeman
ETFreemanOP6mo ago
cool but i think i found decent enough solution in nuxt 3:
//nuxt.config.ts:
srcDir: 'client/',
serverDir: 'server/',
//nuxt.config.ts:
srcDir: 'client/',
serverDir: 'server/',
at least this works for me for now
João Paulo
João Paulo6mo ago
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
Want results from more Discord servers?
Add your server