提交 5a3a7633 编写于 作者: V vben

chore: chalk is replaced by piccolors

上级 41410161
import path from 'path';
import fs from 'fs-extra';
import inquirer from 'inquirer';
import chalk from 'chalk';
import colors from 'picocolors';
import pkg from '../../../package.json';
async function generateIcon() {
......@@ -64,7 +64,7 @@ async function generateIcon() {
}
fs.emptyDir(path.join(process.cwd(), 'node_modules/.vite'));
console.log(
`✨ ${chalk.cyan(`[${pkg.name}]`)}` + ' - Icon generated successfully:' + `[${prefixSet}]`,
`✨ ${colors.cyan(`[${pkg.name}]`)}` + ' - Icon generated successfully:' + `[${prefixSet}]`,
);
});
}
......
......@@ -3,7 +3,7 @@
*/
import { GLOB_CONFIG_FILE_NAME, OUTPUT_DIR } from '../constant';
import fs, { writeFileSync } from 'fs-extra';
import chalk from 'chalk';
import colors from 'picocolors';
import { getEnvConfig, getRootPath } from '../utils';
import { getConfigFileName } from '../getConfigFileName';
......@@ -31,10 +31,10 @@ function createConfig(params: CreateConfigParams) {
fs.mkdirp(getRootPath(OUTPUT_DIR));
writeFileSync(getRootPath(`${OUTPUT_DIR}/${configFileName}`), configStr);
console.log(chalk.cyan(`✨ [${pkg.name}]`) + ` - configuration file is build successfully:`);
console.log(chalk.gray(OUTPUT_DIR + '/' + chalk.green(configFileName)) + '\n');
console.log(colors.cyan(`✨ [${pkg.name}]`) + ` - configuration file is build successfully:`);
console.log(colors.gray(OUTPUT_DIR + '/' + colors.green(configFileName)) + '\n');
} catch (error) {
console.log(chalk.red('configuration file configuration file failed to package:\n' + error));
console.log(colors.red('configuration file configuration file failed to package:\n' + error));
}
}
......
// #!/usr/bin/env node
import { runBuildConfig } from './buildConf';
import chalk from 'chalk';
import colors from 'picocolors';
import pkg from '../../package.json';
......@@ -14,9 +14,9 @@ export const runBuild = async () => {
runBuildConfig();
}
console.log(`✨ ${chalk.cyan(`[${pkg.name}]`)}` + ' - build successfully!');
console.log(`✨ ${colors.cyan(`[${pkg.name}]`)}` + ' - build successfully!');
} catch (error) {
console.log(chalk.red('vite build error:\n' + error));
console.log(colors.red('vite build error:\n' + error));
process.exit(1);
}
};
......
......@@ -68,6 +68,7 @@ specifiers:
npm-run-all: ^4.1.5
nprogress: ^0.2.0
path-to-regexp: ^6.2.0
picocolors: ^1.0.0
pinia: 2.0.12
postcss: ^8.4.12
postcss-html: ^1.3.0
......@@ -196,6 +197,7 @@ devDependencies:
less: 4.1.2
lint-staged: 12.3.7
npm-run-all: 4.1.5
picocolors: 1.0.0
postcss: 8.4.12
postcss-html: 1.3.0
postcss-less: 6.0.0_postcss@8.4.12
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册