Skip to content Skip to sidebar Skip to footer

Set Path To Output Folder In Nuxt

Working in windows, I'm able to generate a static site from my nuxt project using $ npx nuxt generate I'm interested in setting the output folder for the generated static files.

Solution 1:

use below config into nuxt.config.js under module.exports, So your generate folder will be my-dist instead of dist

module.exports = {
  mode: 'spa',
  generate: {
    dir: 'my-dist'
  },
...............
.............
}

and if you want to use custom folder to keep all js,css and assests under dist folder for spa generate then use below config into nuxt.config.js under build object

publicPath: 'public/'

example:

  build: {
    publicPath: 'public/',
.........
............
}

Post a Comment for "Set Path To Output Folder In Nuxt"