mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(@vant/cli): release plugin not work
This commit is contained in:
parent
30510c01c6
commit
4f40157057
14
packages/vant-cli/cjs/vant-cli-release-plugin.cjs
Normal file
14
packages/vant-cli/cjs/vant-cli-release-plugin.cjs
Normal file
@ -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;
|
@ -4,7 +4,7 @@ import { join, dirname } from 'path';
|
|||||||
import { fileURLToPath } from 'url';
|
import { fileURLToPath } from 'url';
|
||||||
|
|
||||||
const __dirname = dirname(fileURLToPath(import.meta.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 }) {
|
export async function release(command: { tag?: string }) {
|
||||||
await releaseIt({
|
await releaseIt({
|
||||||
|
@ -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;
|
|
Loading…
x
Reference in New Issue
Block a user