Firebase ionic2-rc0 和 rollup - “rollup:强烈建议不要使用 `eval`”

Dee*_*Dee 1 firebase rollupjs ionic2 angularfire2 angular

我已将我的 ionic 应用程序从 beta 11 更新到 rc0。所以这意味着我已经从 Angular2 RC4 切换到 Angular2 stable,从 TypeScript 1.8 切换到 2,并使用 rollupjs 模块捆绑器。

我已经根据这篇博客文章配置了 AngularFire2: Ionic 2 RC0、Firebase 3 + AngularFire 2 入门

我无法编译并收到此错误:

rollup:强烈建议不要使用 ofeval(在 c:\XXX\node_modules\angularfire2\node_modules\firebase\firebase.js 中),因为它会带来安全风险,并可能导致缩小问题。 有关更多详细信息,请参阅 https://github.com/rollup/rollup/wiki/Troubleshooting#avoiding-eval

有人知道发生了什么事以及如何解决这个问题吗?

ash*_*ash 5

您可以在汇总配置中禁用此警告:

// rollup.config.js

export default {
  // ...other config...
  onwarn: function (message) {
    if (/Use of `eval` \(in .*\/node_modules\/firebase\/.*\) is strongly discouraged/.test(message)) {
      return;
    }
    console.error(message);
  }
};
Run Code Online (Sandbox Code Playgroud)