Skip to content

Commit

Permalink
chore(v2): Adopt corejs 3 and only import at entry point
Browse files Browse the repository at this point in the history
  • Loading branch information
SamChou19815 committed Jul 14, 2020
1 parent f947036 commit 877ce2d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/docusaurus-plugin-pwa/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ function getSWBabelLoader() {
[
require.resolve('@babel/preset-env'),
{
useBuiltIns: 'usage',
corejs: '2',
useBuiltIns: 'entry',
corejs: '3',
// See https://twitter.com/jeffposnick/status/1280223070876315649
targets: 'chrome >= 56',
},
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"@babel/preset-react": "^7.9.4",
"@babel/preset-typescript": "^7.9.0",
"@babel/runtime": "^7.9.2",
"@babel/runtime-corejs3": "^7.10.4",
"@docusaurus/types": "^2.0.0-alpha.58",
"@docusaurus/utils": "^2.0.0-alpha.58",
"@endiliey/static-site-generator-webpack-plugin": "^4.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/docusaurus/src/babel/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ function getTransformOptions(isServer: boolean): TransformOptions {
: [
require.resolve('@babel/preset-env'),
{
useBuiltIns: 'usage',
useBuiltIns: 'entry',
loose: true,
corejs: '2',
corejs: '3',
// Do not transform modules to CJS
modules: false,
// Exclude transforms that make all code slower
Expand Down
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,14 @@
pirates "^4.0.0"
source-map-support "^0.5.16"

"@babel/runtime-corejs3@^7.10.4":
version "7.10.4"
resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.10.4.tgz#f29fc1990307c4c57b10dbd6ce667b27159d9e0d"
integrity sha512-BFlgP2SoLO9HJX9WBwN67gHWMBhDX/eDz64Jajd6mR/UAUzqrNMm99d4qHnVaKscAElZoFiPv+JpR/Siud5lXw==
dependencies:
core-js-pure "^3.0.0"
regenerator-runtime "^0.13.4"

"@babel/runtime-corejs3@^7.7.4":
version "7.7.7"
resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.7.7.tgz#78fcbd472daec13abc42678bfc319e58a62235a3"
Expand Down

0 comments on commit 877ce2d

Please sign in to comment.