File tree 2 files changed +26
-21
lines changed
2 files changed +26
-21
lines changed Original file line number Diff line number Diff line change 1
1
module . exports = {
2
- "plugins" : [ "@babel/plugin-syntax-dynamic-import" ] ,
3
- "env" : {
4
- "test" : {
5
- "plugins" : [ "dynamic-import-node" ] ,
6
- "presets" : [
7
- [ "@babel/env" , {
2
+ env : {
3
+ test : {
4
+ plugins : [
5
+ '@babel/plugin-syntax-dynamic-import' ,
6
+ 'dynamic-import-node'
7
+ ] ,
8
+ presets : [
9
+ [ '@babel/preset-env' , {
8
10
targets : {
9
- node : " current"
11
+ node : ' current'
10
12
}
11
13
} ]
12
- ]
14
+ ] ,
13
15
}
14
- } ,
16
+ }
15
17
}
Original file line number Diff line number Diff line change @@ -18,6 +18,18 @@ const banner = `/**
18
18
*/
19
19
`
20
20
21
+ const babelConfig = ( ) => ( {
22
+ presets : [
23
+ [ '@babel/preset-env' , {
24
+ targets : {
25
+ node : 8 ,
26
+ ie : 9 ,
27
+ safari : '5.1'
28
+ }
29
+ } ]
30
+ ]
31
+ } )
32
+
21
33
function rollupConfig ( {
22
34
plugins = [ ] ,
23
35
...config
@@ -50,8 +62,9 @@ function rollupConfig({
50
62
plugins : [
51
63
json ( ) ,
52
64
nodeResolve ( ) ,
65
+ replace ( replaceConfig ) ,
53
66
commonjs ( ) ,
54
- replace ( replaceConfig )
67
+ babel ( babelConfig ( ) ) ,
55
68
] . concat ( plugins ) ,
56
69
} )
57
70
}
@@ -61,18 +74,14 @@ export default [
61
74
{
62
75
output : {
63
76
file : pkg . web ,
64
- } ,
65
- plugins : [
66
- babel ( )
67
- ]
77
+ }
68
78
} ,
69
79
// minimized umd web build
70
80
{
71
81
output : {
72
82
file : pkg . web . replace ( '.js' , '.min.js' ) ,
73
83
} ,
74
84
plugins : [
75
- babel ( ) ,
76
85
terser ( )
77
86
]
78
87
} ,
@@ -83,9 +92,6 @@ export default [
83
92
file : pkg . main ,
84
93
format : 'cjs'
85
94
} ,
86
- plugins : [
87
- babel ( )
88
- ] ,
89
95
external : Object . keys ( pkg . dependencies )
90
96
} ,
91
97
// esm build
@@ -95,9 +101,6 @@ export default [
95
101
file : pkg . web . replace ( '.js' , '.esm.js' ) ,
96
102
format : 'es'
97
103
} ,
98
- plugins : [
99
- babel ( )
100
- ] ,
101
104
external : Object . keys ( pkg . dependencies )
102
105
} ,
103
106
// browser esm build
You can’t perform that action at this time.
0 commit comments