neverland beeb059401
perf(cli): improve cli boot time (#10780)
* chore: test

* perf(cli): improve cli boot time
2022-07-03 10:53:14 +08:00

10 lines
328 B
TypeScript
Executable File

// @ts-ignore
import fs from 'fs';
import { URL, fileURLToPath } from 'url';
const packagePath = fileURLToPath(new URL('../package.json', import.meta.url));
const packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf-8'));
export const cliVersion: string = packageJson.version;
process.env.VANT_CLI_VERSION = cliVersion;