@next2d/builder 0.0.9 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +15 -13
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -118,7 +118,7 @@ const CAPACITOR_CONFIG_NAME = "capacitor.config.json";
118
118
  * @public
119
119
  */
120
120
  const loadConfig = () => {
121
- return new Promise(async (resolve) => {
121
+ return new Promise((resolve) => {
122
122
  const packageJson = JSON.parse(fs.readFileSync(`${process.cwd()}/package.json`, { "encoding": "utf8" }));
123
123
  if (packageJson.type !== "module") {
124
124
  packageJson.type = "module";
@@ -126,20 +126,22 @@ const loadConfig = () => {
126
126
  fs.writeFileSync(`${process.cwd()}/package.json`, JSON.stringify(packageJson, null, 2));
127
127
  }
128
128
  const ext = fs.existsSync(`${process.cwd()}/vite.config.ts`) ? "ts" : "js";
129
- const config = await loadConfigFromFile({
129
+ loadConfigFromFile({
130
130
  "command": "build",
131
131
  "mode": "build"
132
- }, `${process.cwd()}/vite.config.${ext}`);
133
- // update config
134
- $configObject = config;
135
- $outDir = $configObject.config?.build?.outDir || "dist";
136
- $buildDir = `${process.cwd()}/${$outDir}/${platformDir}/${environment}`;
137
- if (!fs.existsSync(`${$buildDir}`)) {
138
- fs.mkdirSync(`${$buildDir}`, { "recursive": true });
139
- console.log(pc.green(`Create build directory: ${$buildDir}`));
140
- console.log();
141
- }
142
- resolve();
132
+ }, `${process.cwd()}/vite.config.${ext}`)
133
+ .then((config) => {
134
+ // update config
135
+ $configObject = config;
136
+ $outDir = $configObject.config?.build?.outDir || "dist";
137
+ $buildDir = `${process.cwd()}/${$outDir}/${platformDir}/${environment}`;
138
+ if (!fs.existsSync(`${$buildDir}`)) {
139
+ fs.mkdirSync(`${$buildDir}`, { "recursive": true });
140
+ console.log(pc.green(`Create build directory: ${$buildDir}`));
141
+ console.log();
142
+ }
143
+ resolve();
144
+ });
143
145
  });
144
146
  };
145
147
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next2d/builder",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "description": "Multi-platform builder for Next2d Framework, supporting export to various platforms such as macOS, Windows, iOS, Android and Web(HTML)",
5
5
  "author": "Toshiyuki Ienaga <ienaga@next2d.app>",
6
6
  "license": "MIT",