Browse Source

update: build script

dev
powersir 1 year ago
parent
commit
61746fdcfc
2 changed files with 5 additions and 2 deletions
  1. +3
    -2
      build/script/buildConf.ts
  2. +2
    -0
      package.json

+ 3
- 2
build/script/buildConf.ts View File

@@ -2,7 +2,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 { GLOB_CONFIG_FILE_NAME, OUTPUT_DIR } from '../constant'; import { GLOB_CONFIG_FILE_NAME, OUTPUT_DIR } from '../constant';
import fs, { writeFileSync } from 'fs-extra';
import fs from 'fs-extra';
import colors from 'picocolors'; import colors from 'picocolors';


import { getEnvConfig, getRootPath } from '../utils'; import { getEnvConfig, getRootPath } from '../utils';
@@ -31,7 +31,8 @@ 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');


+ 2
- 0
package.json View File

@@ -48,10 +48,12 @@
"@typescript-eslint/parser": "^6.0.0", "@typescript-eslint/parser": "^6.0.0",
"@vitejs/plugin-react": "^4.0.3", "@vitejs/plugin-react": "^4.0.3",
"autoprefixer": "^10.4.14", "autoprefixer": "^10.4.14",
"cross-env": "^7.0.3",
"dotenv": "^16.3.1", "dotenv": "^16.3.1",
"eslint": "^8.45.0", "eslint": "^8.45.0",
"eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3", "eslint-plugin-react-refresh": "^0.4.3",
"esno": "^0.17.0",
"fs-extra": "^11.1.1", "fs-extra": "^11.1.1",
"lint-staged": "^13.2.2", "lint-staged": "^13.2.2",
"picocolors": "^1.0.0", "picocolors": "^1.0.0",


Loading…
Cancel
Save