Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

Commit

Permalink
Remove core-js and @babel/transform-runtime from lib code
Browse files Browse the repository at this point in the history
Also remove stage-4 syntax transforms covered by @babel/preset-env
  • Loading branch information
wegry committed Sep 16, 2020
1 parent 942d14c commit ec7473e
Show file tree
Hide file tree
Showing 18 changed files with 520 additions and 365 deletions.
22 changes: 22 additions & 0 deletions babel.config.js
@@ -0,0 +1,22 @@
const BABEL_ENV = process.env.BABEL_ENV;
const IS_TEST = BABEL_ENV === "test"
const ignore = IS_TEST ? [] : ['test/**/*.js']
const targets = IS_TEST ? { node: "current" } : { browsers: "defaults" }

module.exports = {
presets: [
[
"@babel/preset-env",
{
modules: ["cjs", "test"].includes(BABEL_ENV) ? "commonjs" : false,
targets
},
],
"@babel/preset-react"
],
plugins: [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-optional-chaining"
],
ignore,
};
49 changes: 2 additions & 47 deletions packages/antd/babel.config.js
@@ -1,48 +1,3 @@
const BABEL_ENV = process.env.BABEL_ENV;
const defaultConfig = require('../../babel.config')

const defaultPlugins = [];

module.exports = {
"presets": [
[
"@babel/preset-env",
{
modules: ["cjs", "test"].includes(BABEL_ENV) ? "commonjs" : false,
targets:
BABEL_ENV === "test" ? { node: "current" } : { browsers: "defaults" },
},
],
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-proposal-class-properties",
[
"@babel/plugin-transform-runtime",
{
"corejs": 2
}
]
],
"env": {
cjs: {
plugins: defaultPlugins,
ignore: ['test/**/*.js']
},
umd: {
plugins: defaultPlugins,
ignore: ['test/**/*.js']
},
es: {
plugins: [
...defaultPlugins,
['@babel/plugin-transform-runtime', { useESModules: true, corejs: 2 }]
],
ignore: ['test/**/*.js']
},
test: {
plugins: defaultPlugins,
ignore: []
}
}
};
module.exports = defaultConfig
45 changes: 6 additions & 39 deletions packages/antd/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions packages/antd/package.json
Expand Up @@ -28,7 +28,6 @@
"@rjsf/core": "^2.0.0",
"antd": "^4.0.0",
"antd-dayjs-webpack-plugin": "1.0.0",
"core-js": "^2.5.7",
"dayjs": "^1.8.0",
"lodash": "^4.17.15",
"react": ">=16"
Expand All @@ -38,20 +37,16 @@
"@babel/cli": "^7.4.4",
"@babel/core": "^7.4.5",
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/plugin-proposal-object-rest-spread": "^7.5.5",
"@babel/plugin-transform-react-jsx": "^7.3.0",
"@babel/plugin-transform-runtime": "^7.5.5",
"@babel/preset-env": "^7.10.3",
"@babel/preset-react": "^7.0.0",
"@babel/register": "^7.4.4",
"@babel/runtime-corejs2": "^7.10.3",
"@rjsf/core": "^2.4.0",
"antd": "^4.0.0",
"atob": "^2.0.3",
"babel-eslint": "^10.0.1",
"babel-loader": "^8.0.6",
"concurrently": "^5.1.0",
"core-js": "^2.5.7",
"cross-env": "^2.0.1",
"css-loader": "^3.2.0",
"dayjs": "^1.8.0",
Expand Down

0 comments on commit ec7473e

Please sign in to comment.