diff --git a/packages/smooth/package.json b/packages/smooth/package.json index b658f2e..1ddbbf4 100644 --- a/packages/smooth/package.json +++ b/packages/smooth/package.json @@ -36,7 +36,6 @@ "@babel/core": "^7.4.3", "@babel/plugin-proposal-class-properties": "^7.4.0", "@babel/plugin-transform-runtime": "^7.4.3", - "@babel/polyfill": "^7.4.3", "@babel/preset-env": "^7.4.3", "@babel/preset-react": "^7.0.0", "@babel/register": "^7.4.0", @@ -56,6 +55,7 @@ "babel-loader": "^8.0.5", "camelcase": "^5.3.1", "commander": "^2.20.0", + "core-js": "^3.0.1", "cors": "^2.8.5", "cwd": "^0.10.0", "errorhandler": "^1.5.0", @@ -73,6 +73,7 @@ "query-string": "^6.4.2", "react-apollo": "^2.5.3", "react-router-dom": "^5.0.0", + "regenerator-runtime": "^0.13.2", "slugify": "^1.3.4", "tiny-glob": "^0.2.6", "webpack": "^4.29.6", diff --git a/packages/smooth/src/babel/preset.js b/packages/smooth/src/babel/preset.js index 7a1bec8..a9031e1 100644 --- a/packages/smooth/src/babel/preset.js +++ b/packages/smooth/src/babel/preset.js @@ -15,7 +15,7 @@ const nodeConfig = opts => ({ { loose: true, useBuiltIns: 'entry', - corejs: 'core-js@2', + corejs: 'core-js@3', targets: { node: 'current', }, @@ -35,7 +35,7 @@ const webConfig = opts => ({ modules: false, loose: true, useBuiltIns: 'entry', - corejs: 'core-js@2', + corejs: 'core-js@3', ...opts['preset-env'], }, ], diff --git a/packages/smooth/src/client/main-node.js b/packages/smooth/src/client/main-node.js index d8f198c..6be863f 100644 --- a/packages/smooth/src/client/main-node.js +++ b/packages/smooth/src/client/main-node.js @@ -1,4 +1,4 @@ -import '@babel/polyfill' +import 'core-js' export { default as Html } from '__smooth_html' export { default as Root } from './Root' diff --git a/packages/smooth/src/client/main-web.js b/packages/smooth/src/client/main-web.js index c23a148..6c930fa 100644 --- a/packages/smooth/src/client/main-web.js +++ b/packages/smooth/src/client/main-web.js @@ -1,4 +1,6 @@ -import '@babel/polyfill' +import 'core-js' +import 'regenerator-runtime/runtime' + import React from 'react' import ReactDOM from 'react-dom' import { BrowserRouter } from 'react-router-dom' diff --git a/yarn.lock b/yarn.lock index 3159f9e..fc7782c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -746,14 +746,6 @@ "@babel/helper-regex" "^7.4.3" regexpu-core "^4.5.4" -"@babel/polyfill@^7.4.3": - version "7.4.3" - resolved "https://registry.yarnpkg.com/@babel/polyfill/-/polyfill-7.4.3.tgz#332dc6f57b718017c3a8b37b4eea8aa6eeac1187" - integrity sha512-rkv8WIvJshA5Ev8iNMGgz5WZkRtgtiPexiT7w5qevGTuT7ZBfM3de9ox1y9JR5/OXb/sWGBbWlHNa7vQKqku3Q== - dependencies: - core-js "^2.6.5" - regenerator-runtime "^0.13.2" - "@babel/preset-env@^7.4.3": version "7.4.3" resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.4.3.tgz#e71e16e123dc0fbf65a52cbcbcefd072fbd02880" @@ -3996,10 +3988,10 @@ core-js@^1.0.0: resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" integrity sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY= -core-js@^2.6.5: - version "2.6.5" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.5.tgz#44bc8d249e7fb2ff5d00e0341a7ffb94fbf67895" - integrity sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A== +core-js@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.0.1.tgz#1343182634298f7f38622f95e73f54e48ddf4738" + integrity sha512-sco40rF+2KlE0ROMvydjkrVMMG1vYilP2ALoRXcYR4obqbYIuV3Bg+51GEDW+HF8n7NRA+iaA4qD0nD9lo9mew== core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2"