N
Nuxt6mo ago
hswolf

Change Output Dir for generated pages.

Hi, is there a way to change npx nuxi generate output directory? I'm changing the ssr build output dir so It works with my monorepo structure.
export default defineNuxtConfig({
nitro: {
output: {
dir: '../../dist/apps/client,
},
},
}
export default defineNuxtConfig({
nitro: {
output: {
dir: '../../dist/apps/client,
},
},
}
When I use npx nuxi generate It works as expected, BUT, it also generates a symbolic link dist folder in the app root, which is fine, but I prefer it not being created, the docs for the output generation (vite/nitro) weren´t much help. There is a workspace structure attached. Accepted Answer: https://discord.com/channels/473401852243869706/1261547978859085896/1261558385212653708
No description
3 Replies
Lannister
Lannister6mo ago
creating a symbolic link in the project root is by design, I don't think there's much to do about that a semi-hacky way to deal with it is to remove it in a post-build script
"scripts": {
"postbuild": "test -L dist && rm dist || echo 'No symlink found'"
}
"scripts": {
"postbuild": "test -L dist && rm dist || echo 'No symlink found'"
}
make sure to point it to the right path were your dist folder symlink is created
hswolf
hswolfOP6mo ago
Oh so It is indeed by design, I appreciate the answer. I will put a rm script then to delete the folder after build, thank you very much @Lannister
Lannister
Lannister6mo ago
happy coding!
Want results from more Discord servers?
Add your server