From 1ae107ab8383df790b39bd7da62c5150e35853b8 Mon Sep 17 00:00:00 2001 From: xiangheng <11675084@qq.com> Date: Wed, 29 Nov 2023 00:44:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=97=B6=E6=89=93=E5=8C=85go=E5=92=8C?= =?UTF-8?q?=E5=89=8D=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/scripts/build.mjs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/admin/scripts/build.mjs b/admin/scripts/build.mjs index c63c2b2..d579021 100644 --- a/admin/scripts/build.mjs +++ b/admin/scripts/build.mjs @@ -9,14 +9,14 @@ const distPath = path.resolve(cwd, 'dist') const releasePath = path.resolve(cwd, releaseRelativePath) const goProjectPath = path.resolve(cwd, '../server') - -async function build() { +async function build_go() { await execaCommand('goreleaser release --snapshot --clean', { stdio: 'inherit', encoding: 'utf-8', cwd: goProjectPath }) - +} +async function build_frontend() { await execaCommand('vite build', { stdio: 'inherit', encoding: 'utf-8', cwd }) if (existsSync(releasePath)) { await remove(releasePath) @@ -29,7 +29,9 @@ async function build() { } console.log(`文件已复制 ==> ${releaseRelativePath}`) } - +async function build() { + await Promise.allSettled([build_go(), build_frontend()]) +} function copyFile(sourceDir, targetDir) { return new Promise((resolve, reject) => { copy(sourceDir, targetDir, (err) => {