Skip to content

Commit fcf524e

Browse files
jakeNiemiecgauravtiwari
authored andcommitted
fix: Stop babel from rewriting babel helpers in core-js. (#2116)
- Prevents `@babel/plugin-transform-runtime` from rewriting babel helpers in core-js. - Remove unneeded runtime `@babel/runtime-corejs3` cc: #2031, #2109
1 parent 6cb399b commit fcf524e

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
**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**
22

3+
## [[4.0.7]](https://github.com/rails/webpacker/compare/v4.0.6...v4.0.7) - 2019-06-03
4+
5+
- 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)
6+
- 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):
7+
- `@babel/preset-env` should contain `corejs: 3`
8+
- `@babel/plugin-transform-runtime` should contain `corejs: false`
9+
- Removed unneeded runtime `@babel/runtime-corejs3`
10+
311
## [[4.0.6]](https://github.com/rails/webpacker/compare/v4.0.5...v4.0.6) - 2019-05-30
412

513
- Webpack should not be transpiled [#2111](https://github.com/rails/webpacker/pull/2111)
@@ -16,7 +24,7 @@
1624

1725
Please see the diff
1826

19-
### Breaking changes
27+
##### Breaking changes (for pre-existing apps)
2028

2129
- [`@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)
2230

lib/install/config/babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ module.exports = function(api) {
5858
{
5959
helpers: false,
6060
regenerator: true,
61-
corejs: 3
61+
corejs: false
6262
}
6363
],
6464
[

lib/install/examples/react/babel.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ module.exports = function(api) {
6464
require('@babel/plugin-transform-runtime').default,
6565
{
6666
helpers: false,
67-
regenerator: true
67+
regenerator: true,
68+
corejs: false
6869
}
6970
],
7071
[

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"@babel/plugin-transform-runtime": "^7.4.4",
2222
"@babel/preset-env": "^7.4.5",
2323
"@babel/runtime": "^7.4.5",
24-
"@babel/runtime-corejs3": "^7.4.5",
2524
"babel-loader": "^8.0.6",
2625
"babel-plugin-dynamic-import-node": "^2.2.0",
2726
"babel-plugin-macros": "^2.5.0",

yarn.lock

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -622,14 +622,6 @@
622622
js-levenshtein "^1.1.3"
623623
semver "^5.5.0"
624624

625-
"@babel/runtime-corejs3@^7.4.5":
626-
version "7.4.5"
627-
resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.4.5.tgz#7df89702351c5fdc34b5555544fcf11b4ea7051c"
628-
integrity sha512-yxHpUObdpx4zbuLJOHIZkw43E4NbWGsGH+85kRUj+VEcdtjlqI0vDcAja9mwOHqD7/4vCZp69q6eztz/sFDibQ==
629-
dependencies:
630-
core-js-pure "^3.0.0"
631-
regenerator-runtime "^0.13.2"
632-
633625
"@babel/runtime@^7.4.2", "@babel/runtime@^7.4.5":
634626
version "7.4.5"
635627
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.4.5.tgz#582bb531f5f9dc67d2fcb682979894f75e253f12"
@@ -1992,7 +1984,7 @@ core-js-compat@^3.1.1:
19921984
core-js-pure "3.1.3"
19931985
semver "^6.1.0"
19941986

1995-
[email protected], core-js-pure@^3.0.0:
1987+
19961988
version "3.1.3"
19971989
resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.1.3.tgz#4c90752d5b9471f641514f3728f51c1e0783d0b5"
19981990
integrity sha512-k3JWTrcQBKqjkjI0bkfXS0lbpWPxYuHWfMMjC1VDmzU4Q58IwSbuXSo99YO/hUHlw/EB4AlfA2PVxOGkrIq6dA==

0 commit comments

Comments
 (0)