次のような polyfills.ts を持つ anugular-cli 1.0.0-beta.16 を使用しています。
// This file includes polyfills needed by Angular 2 and is loaded before
// the app. You can add your own extra polyfills to this file.
import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es6/function';
import 'core-js/es6/parse-int';
import 'core-js/es6/parse-float';
import 'core-js/es6/number';
import 'core-js/es6/math';
import 'core-js/es6/string';
import 'core-js/es6/date';
import 'core-js/es6/array';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/set';
import 'core-js/es6/reflect';
import 'core-js/es7/reflect';
import 'zone.js/dist/zone';
しかし、この pollyfills ファイルは IE11 では機能せず、Chrome、Firefox、EDGE で機能し、私の main.ts は次のようになります。
import "./polyfills.ts";
import {platformBrowserDynamic} from "@angular/platform-browser-dynamic";
import {enableProdMode} from "@angular/core";
import {environment} from "./environments/environment";
import {AppModule} from "./app/";
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
これを IE11 で実行すると、太い矢印式エラーでエラーが表示されます
SCRIPT1002: Syntax error
この位置の縮小されたjsの場合:
function arrayUnion(arr1, arr2) {
return arr1
.concat(arr2.filter(v => arr1.indexOf(v) === -1));
}
これは私の tsconfig.json がどのように見えるかです
{
"compilerOptions": {
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": ["es6", "dom"],
"mapRoot": "./",
"module": "es6",
"moduleResolution": "node",
"outDir": "../dist/out-tsc",
"sourceMap": true,
"target": "es5",
"typeRoots": [
"../node_modules/@types"
]
}
}
@Cletonこれは私のtsconfigがどのように見えるかです