Skip to content

Commit 2af9a1d

Browse files
committed
refactor: dynamic import release
1 parent abc7c8a commit 2af9a1d

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/core/releaser/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import { escapeRegExp } from "es-toolkit";
66
import { isCI } from "std-env";
77
import { Base } from "../base.js";
88
import Bump from "./bump.js";
9-
import Gitee from "./gitee.js";
10-
import GitHub from "./github.js";
119

1210
export default class Release extends Base {
1311
constructor(ctx: Context) {
@@ -60,11 +58,15 @@ export default class Release extends Base {
6058
this.ctx.release.changelog = this.getChangelog();
6159

6260
// Publish to GitHub, Gitee
63-
if (isGitHubEnabled)
61+
if (isGitHubEnabled) {
62+
const { default: GitHub } = await import("./github.js");
6463
await new GitHub(this.ctx).run();
64+
}
6565

66-
if (isGiteeEnabled)
66+
if (isGiteeEnabled) {
67+
const { default: Gitee } = await import("./gitee.js");
6768
await new Gitee(this.ctx).run();
69+
}
6870

6971
// TODO: Publish to Zotero's official market
7072

0 commit comments

Comments
 (0)