1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-31 19:01:54 +02:00

Use babel-polyfill in place of polyfill.io CDN (#2496)

Update provides support for running the examples app on IE 11.

There appeared to be a number of issues with using `polyfill.io`
with slate. While trying to run the example app on IE 11, I ran
into each of the following:
https://github.com/Financial-Times/polyfill-service/issues/792
https://github.com/Financial-Times/polyfill-service/issues/854
https://github.com/Financial-Times/polyfill-service/issues/1341

`babel-polyfill` provides more robust support for polyfilling and
will allow for better targeting of supported browser envs in the
future (if desired).

Also includes `element-closest` polyfill, which is necessary for
using with IE 11 :(
This commit is contained in:
David Gertmenian-Wong
2019-01-29 16:16:12 -08:00
committed by Ian Storm Taylor
parent 861ba522b8
commit 37bab503b4
3 changed files with 14 additions and 2 deletions

View File

@@ -13,7 +13,14 @@ const IS_PROD = process.env.NODE_ENV === 'production'
const IS_DEV = !IS_PROD
const config = {
entry: ['react-hot-loader/patch', './examples/index.js'],
entry: [
'babel-polyfill',
// COMPAT: Missing in IE 11 and included separately because babel-polyfill does not support DOM elements:
// https://github.com/zloirock/core-js/issues/317
'element-closest',
'react-hot-loader/patch',
'./examples/index.js',
],
output: {
path: path.resolve(__dirname, '../../build'),
filename: '[name]-[hash].js',
@@ -79,7 +86,6 @@ const config = {
content: 'width=device-width, initial-scale=1',
},
],
scripts: ['https://cdn.polyfill.io/v2/polyfill.min.js'],
links: [
'https://fonts.googleapis.com/css?family=Roboto:400,400i,700,700i&subset=latin-ext',
'https://fonts.googleapis.com/icon?family=Material+Icons',