Skip to content

Commit

Permalink
Merge pull request #19 from Next2D/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ienaga authored Nov 12, 2023
2 parents 9191a8d + 1cdd0b5 commit eea8da9
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
"sourceType": "module",
"ecmaVersion": "latest"
},
"extends": "plugin:@typescript-eslint/eslint-recommended",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended"
],
"parser": "@typescript-eslint/parser",
"rules": {
"no-var": "error",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next2d/builder",
"version": "0.0.9",
"version": "0.0.10",
"description": "Multi-platform builder for Next2d Framework, supporting export to various platforms such as macOS, Windows, iOS, Android and Web(HTML)",
"author": "Toshiyuki Ienaga <ienaga@next2d.app>",
"license": "MIT",
Expand Down
34 changes: 18 additions & 16 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const CAPACITOR_CONFIG_NAME: string = "capacitor.config.json";
*/
const loadConfig = (): Promise<void> =>
{
return new Promise(async (resolve): Promise<void> =>
return new Promise((resolve): void =>
{
const packageJson = JSON.parse(
fs.readFileSync(`${process.cwd()}/package.json`, { "encoding": "utf8" })
Expand All @@ -166,26 +166,28 @@ const loadConfig = (): Promise<void> =>

const ext: string = fs.existsSync(`${process.cwd()}/vite.config.ts`) ? "ts" : "js";

const config: any = await loadConfigFromFile(
loadConfigFromFile(
{
"command": "build",
"mode": "build"
},
`${process.cwd()}/vite.config.${ext}`
);

// update config
$configObject = config;
$outDir = $configObject.config?.build?.outDir || "dist";
$buildDir = `${process.cwd()}/${$outDir}/${platformDir}/${environment}`;

if (!fs.existsSync(`${$buildDir}`)) {
fs.mkdirSync(`${$buildDir}`, { "recursive": true });
console.log(pc.green(`Create build directory: ${$buildDir}`));
console.log();
}

resolve();
)
.then((config): void =>
{
// update config
$configObject = config;
$outDir = $configObject.config?.build?.outDir || "dist";
$buildDir = `${process.cwd()}/${$outDir}/${platformDir}/${environment}`;

if (!fs.existsSync(`${$buildDir}`)) {
fs.mkdirSync(`${$buildDir}`, { "recursive": true });
console.log(pc.green(`Create build directory: ${$buildDir}`));
console.log();
}

resolve();
});
});
};

Expand Down

0 comments on commit eea8da9

Please sign in to comment.