跳至内容
sdvcrx's wiki
用户工具
登录
站点工具
搜索
工具
显示页面
过去修订
Export to Markdown
反向链接
最近更改
媒体管理器
网站地图
登录
>
最近更改
媒体管理器
网站地图
您的足迹:
frontend:ie8
本页面只读。您可以查看源文件,但不能更改它。如果您觉得这是系统错误,请联系管理员。
====== IE8 Compatible ====== ===== Polyfill ===== * [[https://github.com/paulmillr/console-polyfill|console polyfill]] 使IE8兼容 ''console.log'' 等方法 * [[https://github.com/es-shims/es5-shim|es5-shim]] * [[https://github.com/es-shims/es5-shim|es5-sham]] * [[https://github.com/aFarkas/html5shiv|html5shiv]] 使IE8兼容HTML5新标签,例如 ''<video>'' * [[https://github.com/scottjehl/Respond|Responsed]] 使IE8支持Media Query * [[https://github.com/bestiejs/json3|json3]] 使IE8支持完整的JSON操作 * [[https://github.com/mathiasbynens/jquery-placeholder|jquery-placeholder]] 使IE8支持input placeholder code snippet: <code html> <!--[if lt IE 9]> <script src="/js/console-polyfill.min.js"></script> <script src="/js/html5shiv.min.js"></script> <script src="/js/respond.min.js"></script> <script src="/js/es5-shim.min.js"></script> <script src="/js/es5-sham.min.js"></script> <script src="/js/json3.min.js"></script> <![endif]--> </code> ==== Babel preset ==== 如果使用[[https://babeljs.io/|babel]]进行代码转换,需要引入以下两个babel plugin转换IE8不支持的保留字 ''default'' * [[https://babeljs.io/docs/plugins/transform-es3-property-literals/|transform-es3-property-literals]] * [[https://babeljs.io/docs/plugins/transform-es3-member-expression-literals/|transform-es3-member-expression-literals]] ===== uglify-js ===== <WRAP center round important 60%> 使用uglify-js时,务必记得启用 ''--screw-ie8=false'' or ''--support-ie8'' 选项 </WRAP> [[https://github.com/mishoo/UglifyJS2|UglifyJS2]] 2.7以上版本已经默认不再支持IE8了,因此需要启用 ''support-ie8'' 选项。 //By default UglifyJS will not try to be IE-proof// 影响范围最广的大概是 jQuery 了,因为默认不再支持IE8会使 [[https://github.com/jquery/jquery/blob/2d4f53416e5f74fa98e0c1d66b6f3c285a12f0ce/src/attributes/prop.js|jQuery 中的propFix失效]],当然这个问题仅在自己uglify jQuery出现,继续用 ''jQuery.min.js'' 应该是没有问题的。 webpack解决方法: <code javascript> new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false, screw_ie8: false }, mangle: { screw_ie8: false }, output: { screw_ie8: false } }) </code>
frontend/ie8.txt
· 最后更改: 2023/12/03 10:24 由
127.0.0.1
页面工具
显示页面
过去修订
反向链接
Export to Markdown
回到顶部