Ionic 3 - IE11中用于ES6的Polyfill不工作 [英] Ionic 3 - Polyfill for ES6 in IE11 Not Working

查看:763
本文介绍了Ionic 3 - IE11中用于ES6的Polyfill不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道Ionic已经声明他们不会支持IE11 - 但是我仍然需要努力尝试在可能的情况下提出某种解决方法!

I am aware that Ionic have stated that they will not be supporting IE11 - however I am still currently obliged by work to try and come up with a workaround of some sort if possible!

我遇到的问题是Ionic在开发环境中构建的main.js文件因为它使用模板文字而在IE11中引发错误。

The issue I am having is the main.js file built by Ionic in the dev environment is throwing an error in IE11 due to it using template literals.

我创建了一个polyfills.ts文件,其中包含以下内容

I have created a polyfills.ts file which includes the following

polyfills.ts

import 'core-js/es6/string';
import 'core-js/fn/string/raw';
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/date';
import 'core-js/es6/array';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/weak-map';
import 'core-js/es6/set';
import 'core-js/es6/reflect';
import 'core-js/es7/reflect';
import 'classlist.js';
import 'web-animations-js';
import 'hammerjs';

和我的 main.ts 文件

import './polyfills'
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import {enableProdMode} from '@angular/core';
import { AppModule } from './app.module';

enableProdMode();

platformBrowserDynamic().bootstrapModule(AppModule);

但它似乎没有解决问题。我可能错过了来自core-js的模块来解决这个问题吗?

However it doesn't seem to be resolving the issue. Am I perhaps missing a module from core-js that would solve this issue?

我们非常感谢任何建议。

Any advice as always is much appreciated.

谢谢!

推荐答案

问题是离子应用程序脚本的版本。

The issue was the version of ionic app scripts.

我有

I had


@ ionic / app-scripts:3.1.0

@ionic/app-scripts: 3.1.0

更新到3.1.2解决了问题!

updating to 3.1.2 resolved the issue!

这篇关于Ionic 3 - IE11中用于ES6的Polyfill不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆