我刚开始打字,面对这个问题,这个问题的答案在另一个问题中给出了完美的答案,但我不知道如何在web pack中做到这一点,因为为该答案提供的解决方案是System.config.js,而我的项目中没有它。这里是这个问题的链接,如果可以解决System.config.js部分的话。
发布于 2017-03-07 22:26:44
遇到同样的问题,使用了webpack expose loader解决了这个问题:
首先,将以下代码添加到捆绑包(vendor.ts)中:
require("expose?GeoFire!geofire");然后将此代码添加到webpack.config.js中的加载器中:
module: {
loaders: [
{ test: require.resolve('geofire'), loader: 'expose?GeoFire' }
]
}最后在你的组件中:
declare var GeoFire: any;https://stackoverflow.com/questions/41639491
复制相似问题