【问题标题】:Copy NuxtJS generated static files to parent folder将 NuxtJS 生成的静态文件复制到父文件夹
【发布时间】:2021-01-01 12:25:50
【问题描述】:

我正在使用 NuxtJS 通过 SSH 在我的服务器上生成 静态文件。运行npm run generate后如何将所有生成的文件从/dist文件夹复制到../../(父

我尝试将 dist dir: 设置为 ../../nuxt.config.js 不允许父文件夹。

options.generate.dir 不能是 rootDir 的父级或与其相同

  generate: {
    dir: '../../',

【问题讨论】:

    标签: webpack nuxt.js config


    【解决方案1】:

    在您的 nuxt.config.js 中使用 target: 'static',它应该可以工作。

    nuxt.config.js:

    target: 'static',
    generate: {
       dir: '../../my-site'
    },
    

    【讨论】:

      猜你喜欢
      • 2022-07-11
      • 2021-06-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-04
      • 2015-08-31
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多