diff --git a/packages/vant-cli/cjs/vant-cli-release-plugin.cjs b/packages/vant-cli/cjs/vant-cli-release-plugin.cjs new file mode 100644 index 000000000..5cd4db383 --- /dev/null +++ b/packages/vant-cli/cjs/vant-cli-release-plugin.cjs @@ -0,0 +1,14 @@ +const releaseIt = require('release-it'); +const { execSync } = require('child_process'); + +class VantCliReleasePlugin extends releaseIt.Plugin { + async beforeRelease() { + // log an empty line + console.log(''); + + execSync('vant-cli build', { stdio: 'inherit' }); + execSync('vant-cli changelog', { stdio: 'inherit' }); + } +} + +module.exports = VantCliReleasePlugin; diff --git a/packages/vant-cli/src/commands/release.ts b/packages/vant-cli/src/commands/release.ts index 52618e206..68d221b62 100644 --- a/packages/vant-cli/src/commands/release.ts +++ b/packages/vant-cli/src/commands/release.ts @@ -4,7 +4,7 @@ import { join, dirname } from 'path'; import { fileURLToPath } from 'url'; const __dirname = dirname(fileURLToPath(import.meta.url)); -const PLUGIN_PATH = join(__dirname, '../compiler/vant-cli-release-plugin.js'); +const PLUGIN_PATH = join(__dirname, '../../cjs/vant-cli-release-plugin.cjs'); export async function release(command: { tag?: string }) { await releaseIt({ diff --git a/packages/vant-cli/src/compiler/vant-cli-release-plugin.ts b/packages/vant-cli/src/compiler/vant-cli-release-plugin.ts deleted file mode 100644 index 03bc1d275..000000000 --- a/packages/vant-cli/src/compiler/vant-cli-release-plugin.ts +++ /dev/null @@ -1,15 +0,0 @@ -import releaseIt from 'release-it'; -import { build } from '../commands/build.js'; -import { changelog } from '../commands/changelog.js'; - -class VantCliReleasePlugin extends releaseIt.Plugin { - async beforeRelease() { - // log an empty line - console.log(''); - - await build(); - await changelog(); - } -} - -module.exports = VantCliReleasePlugin;