angular - Angular 6 - 在 IE11 上使用 lite-server 运行 dist 文件夹不起作用
问题描述
我正在尝试在 IE 上运行我的 Angular 6 dist 文件夹。它在 Chrome 中完美运行。IE 在选项卡中正确显示标题,但页面上没有任何内容。我安装了 classlist.js 和 web-animations-js polyfills。该项目在开发中有效,但在生产中无效。我运行 ng build --prod --build-optimizer 来创建 dist 文件夹。
解决方案
在 polyfills.ts 文件中的 polyfills 下面取消注释,然后重新构建它会起作用。
* BROWSER POLYFILLS
*/
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es6/function';
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/weak-map';
import 'core-js/es6/set';
推荐阅读
- google-calendar-api - 谷歌日历:限制 API 访问单个日历?
- firebase - 使用本机反应设置 Firebase
- php - Symfony 4记住我没有用户名就不能工作
- c# - 从文件反序列化加密对象
- xcode - 为什么在终端中找不到我的 Xcode 项目文件夹?
- javascript - 如何检查对可观察对象的活动订阅以避免 Angular 中的内存泄漏
- fluid - 如何将参数传递给 link.typolink 以进行标记?
- authentication - 如何对 Google Cloud Endpoint 进行经过身份验证的调用?
- elixir - 如何在 Absinthe GraphQL 请求中接受 JSON
- python - 在 Python 中为数据找到合适的多项式拟合