Skip to content

Commit 66b59af

Browse files
committed
fix: review feedback
1 parent 343a10c commit 66b59af

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

packages/open-next/src/build.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ export async function build(
4747
showWindowsWarning();
4848

4949
// Load open-next.config.ts
50-
const tempConfigDir = fs.mkdtempSync(
50+
const tempBuildDir = fs.mkdtempSync(
5151
path.join(os.tmpdir(), ".open-next-temp"),
5252
);
5353
let configPath = compileOpenNextConfigNode(
54-
tempConfigDir,
54+
tempBuildDir,
5555
openNextConfigPath,
5656
nodeExternals,
5757
);
@@ -66,10 +66,10 @@ export async function build(
6666
}
6767
validateConfig(config);
6868

69-
compileOpenNextConfigEdge(tempConfigDir, config, openNextConfigPath);
69+
compileOpenNextConfigEdge(tempBuildDir, config, openNextConfigPath);
7070

7171
// Initialize options
72-
const options = normalizeOptions(config, tempConfigDir);
72+
const options = normalizeOptions(config, tempBuildDir);
7373
logger.setLevel(options.debug ? "debug" : "info");
7474

7575
// Pre-build validation
@@ -176,8 +176,7 @@ function initOutputDir(options: BuildOptions) {
176176
fs.rmSync(options.outputDir, { recursive: true, force: true });
177177
const { buildDir } = options;
178178
fs.mkdirSync(buildDir, { recursive: true });
179-
fs.renameSync(options.tempConfigDir, buildDir);
180-
process.exit(0);
179+
fs.renameSync(options.tempBuildDir, buildDir);
181180
}
182181

183182
async function createWarmerBundle(options: BuildOptions) {

packages/open-next/src/build/helper.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
1717

1818
export type BuildOptions = ReturnType<typeof normalizeOptions>;
1919

20-
export function normalizeOptions(
21-
config: OpenNextConfig,
22-
tempConfigDir: string,
23-
) {
20+
export function normalizeOptions(config: OpenNextConfig, tempBuildDir: string) {
2421
const appPath = path.join(process.cwd(), config.appPath || ".");
2522
const buildOutputPath = path.join(
2623
process.cwd(),
@@ -55,7 +52,7 @@ export function normalizeOptions(
5552
openNextVersion: getOpenNextVersion(),
5653
outputDir,
5754
packager,
58-
tempConfigDir,
55+
tempBuildDir,
5956
};
6057
}
6158

0 commit comments

Comments
 (0)