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 3737 "@babel/preset-flow" : " ^7.9.0" ,
3838 "@babel/preset-react" : " ^7.9.4" ,
3939 "@babel/preset-typescript" : " ^7.9.0" ,
40+ "browserslist" : " ^4.12.0" ,
4041 "chalk" : " ^4.0.0" ,
4142 "cosmiconfig" : " ^6.0.0" ,
4243 "cross-spawn" : " ^7.0.2" ,
6061 "@commitlint/config-conventional" : " ^8.3.4" ,
6162 "@release-it/conventional-changelog" : " ^1.1.4" ,
6263 "@types/babel__core" : " ^7.1.7" ,
64+ "@types/browserslist" : " ^4.8.0" ,
6365 "@types/chalk" : " ^2.2.0" ,
6466 "@types/cross-spawn" : " ^6.0.1" ,
6567 "@types/dedent" : " ^0.7.0" ,
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export default async function build({
3232 modules : 'commonjs' ,
3333 babelrc : options ?. babelrc ,
3434 configFile : options ?. configFile ,
35- copyFlow : options ?. copyFlow ? true : false ,
35+ copyFlow : options ?. copyFlow ,
3636 report,
3737 } ) ;
3838}
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export default async function build({
3232 modules : false ,
3333 babelrc : options ?. babelrc ,
3434 configFile : options ?. configFile ,
35- copyFlow : options ?. copyFlow ? true : false ,
35+ copyFlow : options ?. copyFlow ,
3636 report,
3737 } ) ;
3838}
Original file line number Diff line number Diff line change @@ -2,22 +2,23 @@ import path from 'path';
22import fs from 'fs-extra' ;
33import chalk from 'chalk' ;
44import * as babel from '@babel/core' ;
5+ import browserslist from 'browserslist' ;
56import glob from 'glob' ;
67import { Input } from '../types' ;
78
89type Options = Input & {
9- babelrc ?: boolean | null ;
10- configFile ?: string | false | null ;
10+ babelrc ?: boolean | null | undefined ;
11+ configFile ?: string | false | null | undefined ;
1112 modules : 'commonjs' | false ;
12- copyFlow : boolean ;
13+ copyFlow : boolean | undefined ;
1314} ;
1415
1516export default async function compile ( {
1617 root,
1718 source,
1819 output,
19- babelrc,
20- configFile,
20+ babelrc = false ,
21+ configFile = false ,
2122 modules,
2223 copyFlow,
2324 report,
@@ -62,7 +63,8 @@ export default async function compile({
6263 [
6364 require . resolve ( '@babel/preset-env' ) ,
6465 {
65- targets : {
66+ // @ts -ignore
67+ targets : browserslist . findConfig ( root ) ?? {
6668 browsers : [
6769 '>1%' ,
6870 'last 2 chrome versions' ,
You can’t perform that action at this time.
0 commit comments