【问题标题】:Meteor app doesn't work in productionMeteor 应用程序在生产中不起作用
【发布时间】:2015-06-27 15:46:20
【问题描述】:

我正在尝试在流星应用程序中使用blueimp image gallery。我的图片库正在开发中,但是当我像这样运行它时:

meteor --production

它不起作用。它显示了铁路由器启动画面。同样,如果我将我的应用程序部署到meteor.com,它也不起作用:

meteor deploy blueimpMeteor

see the site

但是,如果我在调试模式下部署我的应用程序,它确实可以工作:

meteor deploy blueimpMeteorDebug --debug

see the debug site

什么可能导致我的流星应用无法在生产模式下运行?

来源:https://github.com/icedTeaFresh/meteorBlueimpBroken

【问题讨论】:

    标签: meteor iron-router blueimp


    【解决方案1】:

    感谢提供来源。我尝试了一些方法,发现这是最简单的:

    1. 您不应同时包含插件的 jquery 和非 jquery 版本以及缩小和非缩小版本。我删除了client/compatibility/js 下的所有脚本,jquery.blueimp-gallery.min.js 除外。

    2. home.html 中删除<script> 标签。在流星中,您通常希望在 onRendered 回调中初始化插件,但在这种情况下都不需要。

    3. 如图所示here,您只需将data-gallery 属性添加到您的链接中,如下所示:

    <div id = "links">
      <a href="/1.JPG" title="1" data-gallery>
        <img src="/1.JPG" class="img-thumbnail" alt="1" width="100" height="100">
      </a>
      <a href="/1.JPG" title="1" data-gallery>
        <img src="/1.JPG" class="img-thumbnail" alt="1" width="100" height="100">
      </a>
    </div>
    

    进行这些更改后,它在开发和生产模式下都对我有用。

    【讨论】:

      猜你喜欢
      • 2011-01-31
      • 2015-02-23
      • 2021-03-17
      • 1970-01-01
      • 2016-11-12
      • 2020-04-24
      • 2019-08-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多