|
|
@ -1,7 +1,7 @@ |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Generate additional configuration files when used for packaging. The file can be configured with some global variables, so that it can be changed directly externally without repackaging |
|
|
|
* Generate additional configuration files when used for packaging. The file can be configured with some global variables, so that it can be changed directly externally without repackaging |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
import fs, { writeFileSync } from 'fs-extra' |
|
|
|
import fs from 'fs-extra' |
|
|
|
import colors from 'picocolors' |
|
|
|
import colors from 'picocolors' |
|
|
|
import { GLOB_CONFIG_FILE_NAME, OUTPUT_DIR } from '../constant' |
|
|
|
import { GLOB_CONFIG_FILE_NAME, OUTPUT_DIR } from '../constant' |
|
|
|
|
|
|
|
|
|
|
@ -31,7 +31,7 @@ function createConfig(params: CreateConfigParams) { |
|
|
|
`.replace(/\s/g, '')
|
|
|
|
`.replace(/\s/g, '')
|
|
|
|
|
|
|
|
|
|
|
|
fs.mkdirp(getRootPath(OUTPUT_DIR)) |
|
|
|
fs.mkdirp(getRootPath(OUTPUT_DIR)) |
|
|
|
writeFileSync(getRootPath(`${OUTPUT_DIR}/${configFileName}`), configStr) |
|
|
|
fs.writeFileSync(getRootPath(`${OUTPUT_DIR}/${configFileName}`), configStr) |
|
|
|
|
|
|
|
|
|
|
|
console.log(`${colors.cyan(`✨ [${pkg.name}]`)} - configuration file is build successfully:`) |
|
|
|
console.log(`${colors.cyan(`✨ [${pkg.name}]`)} - configuration file is build successfully:`) |
|
|
|
console.log(`${colors.gray(`${OUTPUT_DIR}/${colors.green(configFileName)}`)}\n`) |
|
|
|
console.log(`${colors.gray(`${OUTPUT_DIR}/${colors.green(configFileName)}`)}\n`) |
|
|
|