【问题标题】:How do I deploy a Nuxtjs static site to Hostgator or another shard hosting provider?如何将 Nuxtjs 静态站点部署到 Hostgator 或其他分片托管服务提供商?
【发布时间】:2021-02-05 08:28:49
【问题描述】:

有没有办法将 Nuxtjs 静态站点部署到像 hostgator 这样的共享托管服务提供商?我认为上传 dist 文件夹并指向 index.html 文件就足够了,但看起来您需要使用 nuxt start 保持应用程序运行?

仅当我在本地测试时运行 nuxt start 时它才对我有用,但不确定如何将其保持在服务器上。我也希望能够与 git 集成以进行持续开发/部署。

任何帮助将不胜感激。

【问题讨论】:

  • 应该足够了 npm run generate 并将 dist 文件夹中的文件上传到您的网络服务器

标签: javascript vue.js static nuxt.js hosting


【解决方案1】:

如果您为static 构建,您只需上传/dist 内容

nuxt.config.js

target: 'static',

终端:nuxt generate

【讨论】:

    猜你喜欢
    • 2018-08-16
    • 2019-02-09
    • 2021-12-03
    • 2020-05-03
    • 2018-04-11
    • 2023-03-18
    • 1970-01-01
    • 1970-01-01
    • 2021-05-13
    相关资源
    最近更新 更多