diff --git a/.eslintrc.json b/.eslintrc.json index 97ac4d0..d52e1e5 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -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", diff --git a/package.json b/package.json index 8ed027c..8cc47d2 100644 --- a/package.json +++ b/package.json @@ -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 ", "license": "MIT", diff --git a/src/index.ts b/src/index.ts index 116a465..1b801a6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -148,7 +148,7 @@ const CAPACITOR_CONFIG_NAME: string = "capacitor.config.json"; */ const loadConfig = (): Promise => { - return new Promise(async (resolve): Promise => + return new Promise((resolve): void => { const packageJson = JSON.parse( fs.readFileSync(`${process.cwd()}/package.json`, { "encoding": "utf8" }) @@ -166,26 +166,28 @@ const loadConfig = (): Promise => 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(); + }); }); };