您的位置:首页 > 游戏 > 手游 > 广州工商代办代理_旅游网官网_网络广告形式_北京疫情最新消息

广州工商代办代理_旅游网官网_网络广告形式_北京疫情最新消息

2025/3/4 17:03:37 来源:https://blog.csdn.net/wjyyhhxit/article/details/145930938  浏览:    关键词:广州工商代办代理_旅游网官网_网络广告形式_北京疫情最新消息
广州工商代办代理_旅游网官网_网络广告形式_北京疫情最新消息

简单记录一下,对于Angular16中,面对低版本的浏览器,快速解决兼容性问题的方案

添加浏览器和node版本的配置文件

  1. 添加文件.browserslistrc
    执行命令:
ng generate config browserslist
  1. 修改文件内容:
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.  
# For additional information regarding the format and rule options, please see:  
# https://github.com/browserslist/browserslist#queries  # For the full list of supported browsers by the Angular framework, please see:  
# https://angular.io/guide/browser-support  # You can see what browsers were selected by your queries by running:  
#   npx browserslist  last 45 Chrome versions  
last 10 Firefox version  
last 10 Edge major versions  
last 2 Safari major versions  
last 2 iOS major versions  
Firefox ESR

添加腻子脚本

  1. 安装兼容性所需要的依赖:
npm i --save @babel/polyfill classlist.js core-js web-animations-js
  1. 配置
    在文件 angular.json中修改architect.build.options.polyfills 数组中添加
"core-js/es/symbol",  
"core-js/es/object",  
"core-js/es/function",  
"core-js/es/parse-int",  
"core-js/es/parse-float",  
"core-js/es/number",  
"core-js/es/math",  
"core-js/es/string",  
"core-js/es/date",  
"core-js/es/array",  
"core-js/es/regexp",  
"core-js/es/map",  
"core-js/es/set",  
"web-animations-js",  
"classList.js",  
"@babel/polyfill"

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com