refactor(@vant/cli): migrate to ESM package

This commit is contained in:
chenjiahan
2021-10-28 20:09:00 +08:00
committed by neverland
parent eec2ac4c0f
commit 1b45f38133
50 changed files with 255 additions and 196 deletions
+13 -10
View File
@@ -1,15 +1,18 @@
// @ts-ignore
import packageJson from '../package.json';
import { dev } from './commands/dev';
import { lint } from './commands/lint';
import { test } from './commands/jest';
import { clean } from './commands/clean';
import { build } from './commands/build';
import { release } from './commands/release';
import { changelog } from './commands/changelog';
import { buildSite } from './commands/build-site';
import { commitLint } from './commands/commit-lint';
import fs from 'fs';
import { URL, fileURLToPath } from 'url';
import { dev } from './commands/dev.js';
import { lint } from './commands/lint.js';
import { test } from './commands/jest.js';
import { clean } from './commands/clean.js';
import { build } from './commands/build.js';
import { release } from './commands/release.js';
import { changelog } from './commands/changelog.js';
import { buildSite } from './commands/build-site.js';
import { commitLint } from './commands/commit-lint.js';
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;