小编典典

Ember CLI生产失败

jenkins

我正在通过jenkins部署Ember CLI应用程序,并使用nginx发布它。这是通过詹金斯构建脚本:

npm install
bower install
node_modules/ember-cli/bin/ember build --environment=production

nginx的配置只是引导sub.domain.comjenkins\jobs\lastStable\archive\dist。效果很好,但是当我转到页面时,该页面为空白,并且在控制台中显示以下输出:

TypeError: Ember.Handlebars.compile is not a function   vendor-92ab6507ac60a5bf7c6819aa8fc418d6.js:18
ReferenceError: Swag is not defined   spa-client-9b01c6124f5b2a4cd2e95b62be7f5ba5.js:1

我猜这两个错误是相关的,但我不知道是什么导致了它们。我曾尝试这个答案似乎是一个类似的问题,但它并没有为我工作。一切在我的开发环境中都可以正常工作,并且在里面我看不到任何可疑的东西Brocfile.js


阅读 262

收藏
2020-07-25

共1个答案

小编典典

生产使用不包含的handlebars-runtime
Ember.Handlebars.compile。原因是它在生产中使用时更小,并且预编译ember-cli自动为您执行的效果更有效。

关于PR的很多讨论都在这里找到

2020-07-25