Skip to content

Commit 11c4cff

Browse files
committedMar 31, 2023
style: optimize output entry file log.
1 parent e8923e0 commit 11c4cff

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed
 

‎packages/core/src/compile.ts

+11-8
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,18 @@ export async function compile(options: CompileOptions = {}) {
1818
});
1919
}
2020
// ==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-
];
2921
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`));
3033
throw new Error(err.join('\n'));
3134
}
3235
babelTransform(options);

0 commit comments

Comments
 (0)
Please sign in to comment.