Files
jdt-mer/build/script/build-cname.js
Huakk 17230a9736
Some checks failed
CI Build & Deploy / build-and-deploy-prod (push) Failing after 3m34s
CI Build & Deploy / build-and-deploy-dev (push) Has been cancelled
ci(other): cicd
2026-01-19 03:12:13 +08:00

16 lines
474 B
JavaScript

import { resolve } from 'path'
import chalk from 'chalk'
import { writeFileSync } from 'fs-extra'
import { OUTPUT_DIR } from '../constant'
import { getEnvConfig, getRootPath } from '../utils'
export function runBuildCNAME() {
const { VITE_CNAME } = getEnvConfig()
if (!VITE_CNAME) return
try {
writeFileSync(resolve(getRootPath(), `${OUTPUT_DIR}/CNAME`), VITE_CNAME)
} catch (error) {
console.log(chalk.red('CNAME file failed to package:\n' + error))
}
}