1
0
mirror of https://github.com/142vip/408CSFamily.git synced 2026-02-02 18:20:26 +08:00

fix: 修复bundle脚本构建异常

This commit is contained in:
chufan
2024-10-16 16:06:14 +08:00
parent 798950b529
commit b17fd0c724

View File

@@ -7,25 +7,24 @@
* - ./scripts/bundle --proxy
*/
import {createRequire} from 'node:module'
import { createRequire } from 'node:module'
import process from 'node:process'
import {
VipDockerAddress,
OPEN_SOURCE_ADDRESS,
buildImage,
getRecentGitCommit,
} from '@142vip/utils'
(async () => {
try {
// 获取package.json文件
const pkg = createRequire(import.meta.url)('../package.json')
// 镜像地址
const imageName = `${VipDockerAddress}/docs:${pkg.name}-${pkg.version}`
const imageName = `${OPEN_SOURCE_ADDRESS.DOCKER_ALIYUNCS_VIP}/docs:${pkg.name}-${pkg.version}`
// 最近一次提交信息
const {hash: gitHash} = await getRecentGitCommit()
const { hash: gitHash } = await getRecentGitCommit()
// 构建镜像
await buildImage({
@@ -41,12 +40,13 @@ import {
['HOME_PAGE', pkg.authorInfo.homePage],
['GIT_HASH', gitHash],
],
memory:20000,
memory: 20000,
push: true,
delete: true,
logger: true,
})
} catch (e) {
}
catch (e) {
console.log('异常信息:', e)
}
})()