diff --git a/CHANGELOG.md b/CHANGELOG.md index 476a661..625d067 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ **Please note that Webpacker 3.1.0 and 3.1.1 have some serious bugs so please consider using either 3.0.2 or 3.2.0** +## [[4.0.7]](https://github.com/rails/webpacker/compare/v4.0.6...v4.0.7) - 2019-06-03 + +- Prevent `@babel/plugin-transform-runtime` from rewriting babel helpers in core-js. Remove unneeded runtime `@babel/runtime-corejs3` [#2116](https://github.com/rails/webpacker/pull/2116) + - Fix for: [#2109 Uncaught TypeError: __webpack_require__(...) is not a function](https://github.com/rails/webpacker/issues/2109): **If you are upgrading**, please check your `babel.config.js` against the [default `babel.config.js`](https://github.com/rails/webpacker/blob/master/lib/install/config/babel.config.js): + - `@babel/preset-env` should contain `corejs: 3` + - `@babel/plugin-transform-runtime` should contain `corejs: false` +- Removed unneeded runtime `@babel/runtime-corejs3` + ## [[4.0.6]](https://github.com/rails/webpacker/compare/v4.0.5...v4.0.6) - 2019-05-30 - Webpack should not be transpiled [#2111](https://github.com/rails/webpacker/pull/2111) @@ -16,7 +24,7 @@ Please see the diff -### Breaking changes +##### Breaking changes (for pre-existing apps) - [`@babel/polyfill`](https://babeljs.io/docs/en/next/babel-polyfill.html) [doesn't make it possible to provide a smooth migration path from `core-js@2` to `core-js@3`](https://github.com/zloirock/core-js/blob/master/docs/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md#babelpolyfill): for this reason, it was decided to deprecate `@babel/polyfill` in favor of separate inclusion of required parts of `core-js` and `regenerator-runtime`. [#2031](https://github.com/rails/webpacker/pull/2031) diff --git a/lib/install/config/babel.config.js b/lib/install/config/babel.config.js index b8b230b..84888b6 100644 --- a/lib/install/config/babel.config.js +++ b/lib/install/config/babel.config.js @@ -58,7 +58,7 @@ module.exports = function(api) { { helpers: false, regenerator: true, - corejs: 3 + corejs: false } ], [ diff --git a/lib/install/examples/react/babel.config.js b/lib/install/examples/react/babel.config.js index ba0ec76..91a7b7c 100644 --- a/lib/install/examples/react/babel.config.js +++ b/lib/install/examples/react/babel.config.js @@ -64,7 +64,8 @@ module.exports = function(api) { require('@babel/plugin-transform-runtime').default, { helpers: false, - regenerator: true + regenerator: true, + corejs: false } ], [ diff --git a/package.json b/package.json index fd93f93..3ce86cf 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ "@babel/plugin-transform-runtime": "^7.4.4", "@babel/preset-env": "^7.4.5", "@babel/runtime": "^7.4.5", - "@babel/runtime-corejs3": "^7.4.5", "babel-loader": "^8.0.6", "babel-plugin-dynamic-import-node": "^2.2.0", "babel-plugin-macros": "^2.5.0", diff --git a/yarn.lock b/yarn.lock index 3d297eb..0c1a914 100644 --- a/yarn.lock +++ b/yarn.lock @@ -622,14 +622,6 @@ js-levenshtein "^1.1.3" semver "^5.5.0" -"@babel/runtime-corejs3@^7.4.5": - version "7.4.5" - resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.4.5.tgz#7df89702351c5fdc34b5555544fcf11b4ea7051c" - integrity sha512-yxHpUObdpx4zbuLJOHIZkw43E4NbWGsGH+85kRUj+VEcdtjlqI0vDcAja9mwOHqD7/4vCZp69q6eztz/sFDibQ== - dependencies: - core-js-pure "^3.0.0" - regenerator-runtime "^0.13.2" - "@babel/runtime@^7.4.2", "@babel/runtime@^7.4.5": version "7.4.5" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.4.5.tgz#582bb531f5f9dc67d2fcb682979894f75e253f12" @@ -1992,7 +1984,7 @@ core-js-compat@^3.1.1: core-js-pure "3.1.3" semver "^6.1.0" -core-js-pure@3.1.3, core-js-pure@^3.0.0: +core-js-pure@3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.1.3.tgz#4c90752d5b9471f641514f3728f51c1e0783d0b5" integrity sha512-k3JWTrcQBKqjkjI0bkfXS0lbpWPxYuHWfMMjC1VDmzU4Q58IwSbuXSo99YO/hUHlw/EB4AlfA2PVxOGkrIq6dA==