【问题标题】:Deploy Vue Production with Wordpress使用 Wordpress 部署 Vue 生产环境
【发布时间】:2019-11-06 17:53:01
【问题描述】:

我为 wordpress 创建了一个 Vue 插件。在我当地的环境中一切正常。这是我的public/index.html。我只包含了这个我的 wordpress 插件。运行npm run serve

现在我有一个问题要部署到我的生产站点。我做了npm run build 并将wordpress 插件更改为指向dist/index.html。但我得到一个空白页。

我还需要运行 npm 服务器吗?

<!DOCTYPE html>
<html lang=" en">

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900|Material+Icons" rel="stylesheet">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
  <title>standing order</title>
</head>

<body>

  <div id="app"></div>
  <!-- built files will be auto injected -->
  <script type="text/javascript" src="http://localhost:8083/app.js?ver=4.9.8"></script>

</body>

</html>

【问题讨论】:

    标签: wordpress vue.js


    【解决方案1】:

    在生产环境中,您拥有文件,但不需要 npm run serve。只需上传捆绑包。

    他们在这里也有更详细的解释。 How to deploy Vue app?

    @AndyHayden AWS S3 检查 1) 索引和错误文档 === index.html; 2) 为静态网站设置策略; 3)您的 build.js 位于 s3 的 dist 文件夹中,而 index.html 位于根目录中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-08-03
      • 1970-01-01
      • 1970-01-01
      • 2017-11-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多