diff --git a/scripts/patchCJS.ts b/scripts/patchCJS.ts index 76edf3fcfa6da5..e225d9455e98dc 100644 --- a/scripts/patchCJS.ts +++ b/scripts/patchCJS.ts @@ -17,7 +17,7 @@ module.exports.parseVueRequest = parseVueRequest; */ import { readFileSync, writeFileSync } from 'fs' -import { bold, red } from 'picocolors' +import colors from 'picocolors' const indexPath = 'dist/index.cjs' let code = readFileSync(indexPath, 'utf-8') @@ -40,7 +40,7 @@ if (matchMixed) { writeFileSync(indexPath, lines.join('\n')) - console.log(bold(`${indexPath} CJS patched`)) + console.log(colors.bold(`${indexPath} CJS patched`)) process.exit() } @@ -49,9 +49,9 @@ const matchDefault = code.match(/\nmodule.exports = (\w+);/) if (matchDefault) { code += `module.exports["default"] = ${matchDefault[1]};\n` writeFileSync(indexPath, code) - console.log(bold(`${indexPath} CJS patched`)) + console.log(colors.bold(`${indexPath} CJS patched`)) process.exit() } -console.error(red(`${indexPath} CJS patch failed`)) +console.error(colors.red(`${indexPath} CJS patch failed`)) process.exit(1)