14
14
// ...
15
15
const
16
16
17
- runtimeVersion = require (
18
- "./package.json" ,
19
- ) . dependencies [ "@babel/runtime-corejs3" ] . replace ( / ^ \^ ? ( .* ) / , ( _ , m ) => m ) ,
20
-
21
17
conf = {
22
18
plugins : [
23
19
"babel-plugin-inline-json-import" ,
@@ -39,7 +35,9 @@ module.exports = function (api) {
39
35
40
36
// linting and jsdoc generation
41
37
development : {
42
- plugins : [ ...conf . plugins , "@babel/plugin-transform-runtime" ] ,
38
+ plugins : [
39
+ ...conf . plugins ,
40
+ ] ,
43
41
presets : [
44
42
"@babel/preset-env" ,
45
43
"@babel/preset-typescript" ,
@@ -49,26 +47,23 @@ module.exports = function (api) {
49
47
// node-compatible modules generation
50
48
commonjs : {
51
49
plugins : [
52
- ...conf . plugins , [
53
- "@babel/plugin-transform-runtime" ,
54
- {
55
- absoluteRuntime : false ,
56
- corejs : 3 ,
57
- version : runtimeVersion ,
58
- } ,
59
- ] ,
50
+ ...conf . plugins ,
60
51
] ,
61
52
comments : false ,
62
53
shouldPrintComment : ( ) => false ,
63
54
presets : [
64
55
[
65
56
"@babel/preset-env" ,
66
57
{
58
+ exclude : [
59
+ "transform-async-to-generator" ,
60
+ "transform-regenerator" ,
61
+ ] ,
67
62
modules : "commonjs" ,
68
- useBuiltIns : false ,
69
63
targets : {
70
64
node : "14.0.0" ,
71
65
} ,
66
+ useBuiltIns : false ,
72
67
} ,
73
68
] ,
74
69
[
@@ -80,26 +75,23 @@ module.exports = function (api) {
80
75
// es-modules generation
81
76
es : {
82
77
plugins : [
83
- ...conf . plugins , [
84
- "@babel/plugin-transform-runtime" ,
85
- {
86
- absoluteRuntime : false ,
87
- corejs : 3 ,
88
- version : runtimeVersion ,
89
- } ,
90
- ] ,
78
+ ...conf . plugins ,
91
79
] ,
92
80
comments : false ,
93
81
shouldPrintComment : ( ) => false ,
94
82
presets : [
95
83
[
96
84
"@babel/preset-env" ,
97
85
{
86
+ exclude : [
87
+ "transform-async-to-generator" ,
88
+ "transform-regenerator" ,
89
+ ] ,
98
90
modules : false ,
99
- useBuiltIns : false ,
100
91
targets : {
101
92
esmodules : true ,
102
93
} ,
94
+ useBuiltIns : false ,
103
95
} ,
104
96
] ,
105
97
[
0 commit comments