运行使用Rollup为AoT编译的Angular 2应用程序时遇到问题,使用angular.io docs(链接here)
的说明据我所知,尽管我将这个作为唯一的输出,但编译过程仍然正常:
⚠️ 'default' is imported from external module 'rollup' but never used
'initializeApp' is not exported by 'node_modules/firebase/firebase-node.js'
'initializeApp' is not exported by 'node_modules/firebase/firebase-node.js'
'app' is not exported by 'node_modules/firebase/firebase-node.js'
'auth' is not exported by 'node_modules/firebase/firebase-node.js'
'database' is not exported by 'node_modules/firebase/firebase-node.js'
'database' is not exported by 'node_modules/firebase/firebase-node.js'
build.js 已创建,我的index.html指向它和其他所需文件:
<!DOCTYPE html>
<html>
<head>
<title>Ahead of time compilation</title>
<base href="/">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="dist/shim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.8.9/zone.min.js"></script>
</head>
<body>
<my-app>Loading...</my-app>
</body>
<script src="dist/build.js"></script>
</html>
然而,当我在浏览器中运行我的应用程序时,我得到未捕获的ReferenceError:未定义导出。
有关如何解决问题的任何建议?