From e2f515840dd03e7da395e3c267cb38904fabd478 Mon Sep 17 00:00:00 2001 From: Tomas Date: Thu, 7 Jun 2018 14:19:16 +1000 Subject: [PATCH 1/3] added BABEL_TRANSFORM_RUNTIME_POLYFILL env var --- config/webpack.config.dev.js | 2 +- config/webpack.config.prod.js | 2 +- template/README.md | 10 +++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js index 81751808..ec462016 100644 --- a/config/webpack.config.dev.js +++ b/config/webpack.config.dev.js @@ -99,7 +99,7 @@ module.exports = { require.resolve('babel-plugin-transform-runtime'), { helpers: false, - polyfill: false, + polyfill: process.env.BABEL_TRANSFORM_RUNTIME_POLYFILL === 'true' ? true : false, regenerator: true } ] diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index 7ba710e4..68325e01 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -122,7 +122,7 @@ module.exports = { require.resolve('babel-plugin-transform-runtime'), { helpers: false, - polyfill: false, + polyfill: process.env.BABEL_TRANSFORM_RUNTIME_POLYFILL === 'true' ? true : false, regenerator: true } ] diff --git a/template/README.md b/template/README.md index c3626bd3..d00b1d1e 100644 --- a/template/README.md +++ b/template/README.md @@ -1,4 +1,4 @@ -# Elm App +#transform-runtime Elm App This project is bootstrapped with [Create Elm App](https://github.com/halfzebra/create-elm-app). @@ -49,6 +49,7 @@ You can find the most recent version of this guide [here](https://github.com/hal * [Static Server](#static-server) * [GitHub Pages](#github-pages) * [IDE setup for Hot Module Replacement](#ide-setup-for-hot-module-replacement) +* [Babel Transform Runtime plugin options](#babel-transform-runtime-plugin-options) ## Sending feedback @@ -850,3 +851,10 @@ GitHub Pages doesn’t support routers that use the HTML5 `pushState` history AP ## IDE setup for Hot Module Replacement Remember to disable [safe write](https://webpack.github.io/docs/webpack-dev-server.html#working-with-editors-ides-supporting-safe-write) if you are using VIM or IntelliJ IDE, such as WebStorm. + +## Babel Transform Runtime plugin options + +By default, Babel Transform Runtime plugin is configured to **not** transform new built-ins (Promise, Set, Map, etc.) to use a non-global polluting polyfill ([Babel Runtime transform plugin documentation](https://babeljs.io/docs/plugins/transform-runtime/)). + +To enable this transformation set `BABEL_TRANSFORM_RUNTIME_POLYFILL` environment variable to `true` or `false` respectively. + From 06868044df67d6aabea74ddf522ad5263e578ee4 Mon Sep 17 00:00:00 2001 From: Tomas Date: Thu, 7 Jun 2018 14:30:05 +1000 Subject: [PATCH 2/3] undo change done by mistake --- template/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/README.md b/template/README.md index d00b1d1e..a50fa16e 100644 --- a/template/README.md +++ b/template/README.md @@ -1,4 +1,4 @@ -#transform-runtime Elm App +# Elm App This project is bootstrapped with [Create Elm App](https://github.com/halfzebra/create-elm-app). From 2d809bb332ecc4580736bcb34aebb8299c0aaa1b Mon Sep 17 00:00:00 2001 From: Tomas Date: Thu, 7 Jun 2018 14:35:28 +1000 Subject: [PATCH 3/3] fix wording --- template/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/README.md b/template/README.md index a50fa16e..7e6c04b3 100644 --- a/template/README.md +++ b/template/README.md @@ -856,5 +856,5 @@ Remember to disable [safe write](https://webpack.github.io/docs/webpack-dev-serv By default, Babel Transform Runtime plugin is configured to **not** transform new built-ins (Promise, Set, Map, etc.) to use a non-global polluting polyfill ([Babel Runtime transform plugin documentation](https://babeljs.io/docs/plugins/transform-runtime/)). -To enable this transformation set `BABEL_TRANSFORM_RUNTIME_POLYFILL` environment variable to `true` or `false` respectively. +To enable this transformation set `BABEL_TRANSFORM_RUNTIME_POLYFILL` environment variable to `true`.