【问题标题】:Angular Universal --bundledependencies "all" won't work with firebase, "none" won't work with my charting module?Angular Universal --bundledependencies“all”不适用于firebase,“none”不适用于我的图表模块?
【发布时间】:2019-08-16 10:36:59
【问题描述】:

我一直在使用基本的 Angular 8.2.x 项目作为样板,将其制成 SSR,一切都很好,但由于@angular/fire,我无法捆绑依赖项,我的应用程序运行它的 auth + firestore + 功能firebase 通过那个包,所以我绝对需要它。

我的应用是一个报告工具,所以我当然也需要图表。问题是,当我不捆绑依赖项并尝试运行它时,我收到以下错误:

SyntaxError: Unexpected token {

在:

node_modules\ngx-charts-extra\release\line-chart\line-chart.component.js:23

在我的图表模块的导入语句中,所以这是在实际的 node_module 中。 This is the link to the package I'm using. -- 在这种情况下,它也是我自己 fork 和构建的模块之一。

有没有一种方法可以让@angular/fire 与 SSR 一起使用,或者我需要一种特定的方法来构建我的图表包,以免在导入语句中出现语法错误?

【问题讨论】:

    标签: javascript angular angularfire2 angular-universal server-side-rendering


    【解决方案1】:

    最终使用 webpack 捆绑为 SSR 并排除了 firebase 模块,我后来将其作为 lambda 层包含在内。

    【讨论】:

      猜你喜欢
      • 2019-08-26
      • 1970-01-01
      • 2022-10-07
      • 2021-05-19
      • 1970-01-01
      • 2023-03-27
      • 2021-02-07
      • 1970-01-01
      • 2020-06-29
      相关资源
      最近更新 更多