File tree Expand file tree Collapse file tree 5 files changed +40
-225
lines changed Expand file tree Collapse file tree 5 files changed +40
-225
lines changed Original file line number Diff line number Diff line change 37
37
"@babel/preset-flow" : " ^7.9.0" ,
38
38
"@babel/preset-react" : " ^7.9.4" ,
39
39
"@babel/preset-typescript" : " ^7.9.0" ,
40
+ "browserslist" : " ^4.12.0" ,
40
41
"chalk" : " ^4.0.0" ,
41
42
"cosmiconfig" : " ^6.0.0" ,
42
43
"cross-spawn" : " ^7.0.2" ,
60
61
"@commitlint/config-conventional" : " ^8.3.4" ,
61
62
"@release-it/conventional-changelog" : " ^1.1.4" ,
62
63
"@types/babel__core" : " ^7.1.7" ,
64
+ "@types/browserslist" : " ^4.8.0" ,
63
65
"@types/chalk" : " ^2.2.0" ,
64
66
"@types/cross-spawn" : " ^6.0.1" ,
65
67
"@types/dedent" : " ^0.7.0" ,
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export default async function build({
32
32
modules : 'commonjs' ,
33
33
babelrc : options ?. babelrc ,
34
34
configFile : options ?. configFile ,
35
- copyFlow : options ?. copyFlow ? true : false ,
35
+ copyFlow : options ?. copyFlow ,
36
36
report,
37
37
} ) ;
38
38
}
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export default async function build({
32
32
modules : false ,
33
33
babelrc : options ?. babelrc ,
34
34
configFile : options ?. configFile ,
35
- copyFlow : options ?. copyFlow ? true : false ,
35
+ copyFlow : options ?. copyFlow ,
36
36
report,
37
37
} ) ;
38
38
}
Original file line number Diff line number Diff line change @@ -2,22 +2,23 @@ import path from 'path';
2
2
import fs from 'fs-extra' ;
3
3
import chalk from 'chalk' ;
4
4
import * as babel from '@babel/core' ;
5
+ import browserslist from 'browserslist' ;
5
6
import glob from 'glob' ;
6
7
import { Input } from '../types' ;
7
8
8
9
type Options = Input & {
9
- babelrc ?: boolean | null ;
10
- configFile ?: string | false | null ;
10
+ babelrc ?: boolean | null | undefined ;
11
+ configFile ?: string | false | null | undefined ;
11
12
modules : 'commonjs' | false ;
12
- copyFlow : boolean ;
13
+ copyFlow : boolean | undefined ;
13
14
} ;
14
15
15
16
export default async function compile ( {
16
17
root,
17
18
source,
18
19
output,
19
- babelrc,
20
- configFile,
20
+ babelrc = false ,
21
+ configFile = false ,
21
22
modules,
22
23
copyFlow,
23
24
report,
@@ -62,7 +63,8 @@ export default async function compile({
62
63
[
63
64
require . resolve ( '@babel/preset-env' ) ,
64
65
{
65
- targets : {
66
+ // @ts -ignore
67
+ targets : browserslist . findConfig ( root ) ?? {
66
68
browsers : [
67
69
'>1%' ,
68
70
'last 2 chrome versions' ,
You can’t perform that action at this time.
0 commit comments