@@ -18,15 +18,18 @@ export async function compile(options: CompileOptions = {}) {
18
18
} ) ;
19
19
}
20
20
// ==Use Babel=============================================
21
- const err = [
22
- '\x1b[31;1m When compiling with\x1b[0m\x1b[33;1m Babel\x1b[0m\x1b[31;1m, you need to specify the compilation file, E.g:\x1b[0m\n' ,
23
- ' \x1b[35;1m$\x1b[0m\x1b[36;1m tsbb\x1b[0m build\x1b[33;1m src/*.{jsx,js}\x1b[0m --useBabel' ,
24
- ' \x1b[35;1m$\x1b[0m\x1b[36;1m tsbb\x1b[0m build\x1b[33;1m "src/**/*.ts"\x1b[0m --useBabel' ,
25
- ' \x1b[35;1m$\x1b[0m\x1b[36;1m tsbb\x1b[0m build\x1b[33;1m src/index.jsx\x1b[0m --useBabel' ,
26
- ' \x1b[35;1m$\x1b[0m\x1b[36;1m tsbb\x1b[0m build\x1b[33;1m src/index.jsx\x1b[0m \x1b[33;1m src/main.jsx\x1b[0m --useBabel\n' ,
27
- ` \x1b[31;1m$ tsbb ${ process . argv . slice ( 2 ) . join ( ' ' ) } \x1b[0m\n\n` ,
28
- ] ;
29
21
if ( ! options . entry ?. length ) {
22
+ const err = [
23
+ '\x1b[31;1m When compiling with\x1b[0m\x1b[33;1m Babel\x1b[0m\x1b[31;1m, you need to specify the compilation file, E.g:\x1b[0m\n' ,
24
+ ' \x1b[35;1m$\x1b[0m\x1b[36;1m tsbb\x1b[0m build\x1b[33;1m src/*.{jsx,js}\x1b[0m --useBabel' ,
25
+ ' \x1b[35;1m$\x1b[0m\x1b[36;1m tsbb\x1b[0m build\x1b[33;1m "src/**/*.ts"\x1b[0m --useBabel' ,
26
+ ' \x1b[35;1m$\x1b[0m\x1b[36;1m tsbb\x1b[0m build\x1b[33;1m src/index.jsx\x1b[0m --useBabel' ,
27
+ ' \x1b[35;1m$\x1b[0m\x1b[36;1m tsbb\x1b[0m build\x1b[33;1m src/index.jsx\x1b[0m \x1b[33;1m src/main.jsx\x1b[0m --useBabel\n' ,
28
+ ' \x1b[31;1mThe command you entered:\x1b[0m\n' ,
29
+ ` \x1b[31;1m$ tsbb ${ process . argv . slice ( 2 ) . join ( ' ' ) } \x1b[0m\n` ,
30
+ ' \x1b[31;1mThe files you need to compile have been indexed:\x1b[0m\n' ,
31
+ ] ;
32
+ ( options . entry || [ ] ) . forEach ( ( fileNames ) => err . push ( ` \x1b[35;1m${ fileNames } \x1b[0m` ) ) ;
30
33
throw new Error ( err . join ( '\n' ) ) ;
31
34
}
32
35
babelTransform ( options ) ;
0 commit comments