File tree 2 files changed +26
-27
lines changed
packages/open-next/src/build
2 files changed +26
-27
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { buildSync } from "esbuild";
6
6
import type { OpenNextConfig } from "types/open-next.js" ;
7
7
8
8
import logger from "../logger.js" ;
9
- import { buildDevConfig } from "./helper .js" ;
9
+ import { DEV_CONFIG } from "./constant .js" ;
10
10
import { validateConfig } from "./validateConfig.js" ;
11
11
12
12
/**
@@ -129,3 +129,28 @@ export function compileOpenNextConfigEdge(
129
129
external : externals ,
130
130
} ) ;
131
131
}
132
+
133
+ function buildDevConfig ( outputPath : string , externals : string [ ] ) {
134
+ buildSync ( {
135
+ stdin : {
136
+ contents : DEV_CONFIG ,
137
+ resolveDir : process . cwd ( ) ,
138
+ loader : "ts" ,
139
+ sourcefile : "open-next.config.ts" ,
140
+ } ,
141
+ outfile : outputPath ,
142
+ bundle : true ,
143
+ format : "esm" ,
144
+ target : [ "node18" ] ,
145
+ external : externals ,
146
+ platform : "node" ,
147
+ banner : {
148
+ js : [
149
+ "import { createRequire as topLevelCreateRequire } from 'module';" ,
150
+ "const require = topLevelCreateRequire(import.meta.url);" ,
151
+ "import bannerUrl from 'url';" ,
152
+ "const __dirname = bannerUrl.fileURLToPath(new URL('.', import.meta.url));" ,
153
+ ] . join ( "" ) ,
154
+ } ,
155
+ } ) ;
156
+ }
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ import type {
11
11
} from "types/open-next.js" ;
12
12
13
13
import logger from "../logger.js" ;
14
- import { DEV_CONFIG } from "./constant.js" ;
15
14
16
15
const require = createRequire ( import . meta. url ) ;
17
16
const __dirname = url . fileURLToPath ( new URL ( "." , import . meta. url ) ) ;
@@ -441,28 +440,3 @@ export async function isEdgeRuntime(
441
440
export function getPackagePath ( options : BuildOptions ) {
442
441
return path . relative ( options . monorepoRoot , options . appBuildOutputPath ) ;
443
442
}
444
-
445
- export function buildDevConfig ( outputPath : string , externals : string [ ] ) {
446
- buildSync ( {
447
- stdin : {
448
- contents : DEV_CONFIG ,
449
- resolveDir : process . cwd ( ) ,
450
- loader : "ts" ,
451
- sourcefile : "open-next.config.ts" ,
452
- } ,
453
- outfile : outputPath ,
454
- bundle : true ,
455
- format : "esm" ,
456
- target : [ "node18" ] ,
457
- external : externals ,
458
- platform : "node" ,
459
- banner : {
460
- js : [
461
- "import { createRequire as topLevelCreateRequire } from 'module';" ,
462
- "const require = topLevelCreateRequire(import.meta.url);" ,
463
- "import bannerUrl from 'url';" ,
464
- "const __dirname = bannerUrl.fileURLToPath(new URL('.', import.meta.url));" ,
465
- ] . join ( "" ) ,
466
- } ,
467
- } ) ;
468
- }
You can’t perform that action at this time.
0 commit comments