任何人都知道如何使用Browserify-Shim Angular 2,同时保持Angular外部而不是在构建中捆绑它?
//package.json
{
"name": "testapp",
"version": "1.0.0",
"main": "./app.js",
"browserify-shim": {
"angular2": "global:angular2"
},
"browserify": {
"transform": [ "browserify-shim" ]
},
"dependencies": {
"browserify-shim": "~3.2.0"
}
}
...
//app.ts
import {Component, View, bootstrap, NgFor} from 'angular2';
结果:
TypeError: angular2_1 is undefined