wireguard-dashboard-admin/build/script/build-cname.js

16 lines
474 B
JavaScript
Raw Normal View History

2022-08-27 14:09:32 +08:00
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() {
2022-08-27 14:09:32 +08:00
const { VITE_CNAME } = getEnvConfig()
if (!VITE_CNAME) return
try {
2022-08-27 14:09:32 +08:00
writeFileSync(resolve(getRootPath(), `${OUTPUT_DIR}/CNAME`), VITE_CNAME)
} catch (error) {
console.log(chalk.red('CNAME file failed to package:\n' + error))
}
}