码迷,mamicode.com
首页 > Web开发 > 详细

[Webpack 2] Polyfill Promises for Webpack 2

时间:2016-06-22 22:05:49      阅读:667      评论:0      收藏:0      [点我收藏+]

标签:

If you‘re going to use code splitting with Webpack 2, you‘ll need to make sure the browser has support for the ES6 Promise API. This means that if you are required to support an old browser, you need to provide a polyfill. Polyfilling is relatively trivial to do with Webpack, but because Webpack itself depends on this particular polyfill, you have to come up with another way of doing so. In this lesson, we‘ll see how we can use the polyfill.io service to automatically polyfill this API (and others) for us.

 

Just include the polyfill into index.html:

<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>

 

Polyfill.io

[Webpack 2] Polyfill Promises for Webpack 2

标签:

原文地址:http://www.cnblogs.com/Answer1215/p/5608554.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!