Reputation: 13
Whenever I run
$ npm run build
on Nuxt SPA mode it generates a ./dist folder and ./nuxt/dist folder.
What's the use of ./nuxt/dist?
Upvotes: 1
Views: 2117
Reputation: 826
The contents in the nuxt/dist folder are what is going to be served up when you are in production. It contains an optimized code to be served to your users.
Upvotes: 0
Reputation: 182
.nuxt/dist is for server side rendering it will be use when you run npm run start on your server and it will start listening on localhost:3000
Upvotes: -1
Reputation: 1385
Nuxt.js lets you upload your dist files to your CDN for maximum performances, simply set the publicPath to your CDN.
export default {
build: {
publicPath: 'https://cdn.nuxtjs.org'
}
}
Then, when launching nuxt build, upload the content of .nuxt/dist/client directory to your CDN.
Ref: https://nuxtjs.org/api/configuration-build/
Upvotes: 1
Reputation: 3455
The dist folder contains html and js files then you can use it to deploy to server and run as statics site.
Upvotes: 4