Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nuxt 3 how to change the path of the static build

after i build the project

npm run generate

it generates a folder .output with the build files

how to change this file to anther, for example instead of .output -> Admin

my nuxt.config.ts

  export default defineNuxtConfig({ 
    ssr: false, 
    app: {
        baseURL: ...,
    },
 });

I know that i can cut and past the folder,

however, is there a propriety that can change the path of the build?

like image 381
zayed Avatar asked Dec 14 '25 13:12

zayed


1 Answers

The Nuxt3 server engine is actually powered by nitro (see the document)

so, in the nuxt.config.[js|ts]

export default defineNuxtConfig({
    nitro: {
        output: {
            dir: '.output',
            serverDir: '.output/server',
            publicDir: '.output/public'
        }
    }
})

See more:

  • Nitro output

  • nuxt-config nitro

like image 166
DengSihan Avatar answered Dec 16 '25 22:12

DengSihan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!