File tree Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @opennextjs/aws " : minor
3
+ ---
4
+
5
+ feat: support absolute paths when compiling opennext configs
Original file line number Diff line number Diff line change
1
+ import path from "node:path" ;
1
2
import url from "node:url" ;
2
3
3
4
import {
@@ -32,8 +33,9 @@ export async function build(
32
33
const openNextDistDir = url . fileURLToPath ( new URL ( "." , import . meta. url ) ) ;
33
34
34
35
const { config, buildDir } = await compileOpenNextConfig (
35
- baseDir ,
36
- openNextConfigPath ,
36
+ openNextConfigPath && path . isAbsolute ( openNextConfigPath )
37
+ ? openNextConfigPath
38
+ : path . join ( baseDir , openNextConfigPath ?? "open-next.config.ts" ) ,
37
39
{ nodeExternals } ,
38
40
) ;
39
41
Original file line number Diff line number Diff line change @@ -13,22 +13,15 @@ import { validateConfig } from "./validateConfig.js";
13
13
*
14
14
* The configuration is always compiled for Node.js and for the edge only if needed.
15
15
*
16
- * @param baseDir Directory where to look for the configuration.
17
- * @param openNextConfigPath Override the default configuration when provided. Relative to baseDir.
16
+ * @param sourcePath Path to the configuration file.
18
17
* @param nodeExternals Coma separated list of Externals for the Node.js compilation.
19
18
* @param compileEdge Force compiling for the edge runtime when true
20
19
* @return The configuration and the build directory.
21
20
*/
22
21
export async function compileOpenNextConfig (
23
- baseDir : string ,
24
- openNextConfigPath ?: string ,
22
+ sourcePath : string ,
25
23
{ nodeExternals = "" , compileEdge = false } = { } ,
26
24
) {
27
- const sourcePath = path . join (
28
- baseDir ,
29
- openNextConfigPath ?? "open-next.config.ts" ,
30
- ) ;
31
-
32
25
const buildDir = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , "open-next-tmp" ) ) ;
33
26
let configPath = compileOpenNextConfigNode (
34
27
sourcePath ,
You can’t perform that action at this time.
0 commit comments