Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

publish #20

Merged
merged 3 commits into from
Nov 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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