Set path to output folder in Nuxt

前端 未结 1 1450
别那么骄傲
别那么骄傲 2021-01-14 02:46

Working in windows, I\'m able to generate a static site from my nuxt project using

$ npx nuxt generate

I\'m interested in setting

1条回答
  •  孤城傲影
    2021-01-14 03:29

    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/',
    .........
    ............
    }
    

    0 讨论(0)
提交回复
热议问题