Skip to content

Commit a83ae37

Browse files
committed
config: babel - aligned with js-toolbox.
1 parent 1660a9a commit a83ae37

File tree

1 file changed

+15
-23
lines changed

1 file changed

+15
-23
lines changed

babel.config.js

+15-23
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
// ...
1515
const
1616

17-
runtimeVersion = require(
18-
"./package.json",
19-
).dependencies["@babel/runtime-corejs3"].replace(/^\^?(.*)/, (_, m) => m),
20-
2117
conf = {
2218
plugins: [
2319
"babel-plugin-inline-json-import",
@@ -39,7 +35,9 @@ module.exports = function (api) {
3935

4036
// linting and jsdoc generation
4137
development: {
42-
plugins: [...conf.plugins, "@babel/plugin-transform-runtime"],
38+
plugins: [
39+
...conf.plugins,
40+
],
4341
presets: [
4442
"@babel/preset-env",
4543
"@babel/preset-typescript",
@@ -49,26 +47,23 @@ module.exports = function (api) {
4947
// node-compatible modules generation
5048
commonjs: {
5149
plugins: [
52-
...conf.plugins, [
53-
"@babel/plugin-transform-runtime",
54-
{
55-
absoluteRuntime: false,
56-
corejs: 3,
57-
version: runtimeVersion,
58-
},
59-
],
50+
...conf.plugins,
6051
],
6152
comments: false,
6253
shouldPrintComment: () => false,
6354
presets: [
6455
[
6556
"@babel/preset-env",
6657
{
58+
exclude: [
59+
"transform-async-to-generator",
60+
"transform-regenerator",
61+
],
6762
modules: "commonjs",
68-
useBuiltIns: false,
6963
targets: {
7064
node: "14.0.0",
7165
},
66+
useBuiltIns: false,
7267
},
7368
],
7469
[
@@ -80,26 +75,23 @@ module.exports = function (api) {
8075
// es-modules generation
8176
es: {
8277
plugins: [
83-
...conf.plugins, [
84-
"@babel/plugin-transform-runtime",
85-
{
86-
absoluteRuntime: false,
87-
corejs: 3,
88-
version: runtimeVersion,
89-
},
90-
],
78+
...conf.plugins,
9179
],
9280
comments: false,
9381
shouldPrintComment: () => false,
9482
presets: [
9583
[
9684
"@babel/preset-env",
9785
{
86+
exclude: [
87+
"transform-async-to-generator",
88+
"transform-regenerator",
89+
],
9890
modules: false,
99-
useBuiltIns: false,
10091
targets: {
10192
esmodules: true,
10293
},
94+
useBuiltIns: false,
10395
},
10496
],
10597
[

0 commit comments

Comments
 (0)