|
@@ -2,9 +2,9 @@ const CONFIG_NAME = "__PRODUCTION____APP__CONF__";
|
|
const CONFIG_FILE_NAME = "_app.config.js";
|
|
const CONFIG_FILE_NAME = "_app.config.js";
|
|
const OUTPUT_DIR = "release/dist";
|
|
const OUTPUT_DIR = "release/dist";
|
|
|
|
|
|
-const path = require("path");
|
|
|
|
-const dotenv = require("dotenv");
|
|
|
|
-const fs = require("fs-extra");
|
|
|
|
|
|
+import path from "path";
|
|
|
|
+import dotenv from "dotenv";
|
|
|
|
+import fs from "fs";
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取用户根目录
|
|
* 获取用户根目录
|
|
@@ -62,7 +62,9 @@ function createConfig(params) {
|
|
const filePath = `${OUTPUT_DIR}/`;
|
|
const filePath = `${OUTPUT_DIR}/`;
|
|
|
|
|
|
// 创建根目录
|
|
// 创建根目录
|
|
- fs.mkdirp(getRootPath(filePath));
|
|
|
|
|
|
+ fs.mkdirSync(getRootPath(filePath), {
|
|
|
|
+ recursive: true,
|
|
|
|
+ });
|
|
fs.writeFileSync(getRootPath(filePath + configFileName), configStr);
|
|
fs.writeFileSync(getRootPath(filePath + configFileName), configStr);
|
|
|
|
|
|
console.log(`✨ 配置文件构建成功:`);
|
|
console.log(`✨ 配置文件构建成功:`);
|