File tree Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -2,10 +2,10 @@ import fs from "node:fs/promises";
2
2
import path from "node:path" ;
3
3
4
4
import type { IncrementalCache } from "types/overrides.js" ;
5
- import { getOutputDir } from "utils/normalize-path" ;
5
+ import { getMonorepoRelativePath } from "utils/normalize-path" ;
6
6
7
7
const buildId = process . env . NEXT_BUILD_ID ;
8
- const basePath = path . join ( getOutputDir ( ) , `cache/${ buildId } ` ) ;
8
+ const basePath = path . join ( getMonorepoRelativePath ( ) , `cache/${ buildId } ` ) ;
9
9
10
10
const getCacheKey = ( key : string ) => {
11
11
return path . join ( basePath , `${ key } .cache` ) ;
Original file line number Diff line number Diff line change @@ -2,10 +2,10 @@ import fs from "node:fs";
2
2
import path from "node:path" ;
3
3
4
4
import type { TagCache } from "types/overrides" ;
5
- import { getOutputDir } from "utils/normalize-path" ;
5
+ import { getMonorepoRelativePath } from "utils/normalize-path" ;
6
6
7
7
const tagFile = path . join (
8
- getOutputDir ( ) ,
8
+ getMonorepoRelativePath ( ) ,
9
9
"dynamodb-provider/dynamodb-cache.json" ,
10
10
) ;
11
11
const tagContent = fs . readFileSync ( tagFile , "utf-8" ) ;
Original file line number Diff line number Diff line change @@ -3,15 +3,15 @@ import express from "express";
3
3
4
4
import type { StreamCreator } from "types/open-next.js" ;
5
5
import type { WrapperHandler } from "types/overrides.js" ;
6
- import { getOutputDir } from "utils/normalize-path" ;
6
+ import { getMonorepoRelativePath } from "utils/normalize-path" ;
7
7
8
8
const wrapper : WrapperHandler = async ( handler , converter ) => {
9
9
const app = express ( ) ;
10
10
// To serve static assets
11
- app . use ( express . static ( path . join ( getOutputDir ( ) , "assets" ) ) ) ;
11
+ app . use ( express . static ( path . join ( getMonorepoRelativePath ( ) , "assets" ) ) ) ;
12
12
13
13
const imageHandlerPath = path . join (
14
- getOutputDir ( ) ,
14
+ getMonorepoRelativePath ( ) ,
15
15
"image-optimization-function/index.mjs" ,
16
16
) ;
17
17
Original file line number Diff line number Diff line change @@ -4,13 +4,13 @@ export function normalizePath(path: string) {
4
4
return path . replace ( / \\ / g, "/" ) ;
5
5
}
6
6
7
- export function getOutputDir ( ) {
7
+ export function getMonorepoRelativePath ( relativePath = "../../" ) : string {
8
8
return path . join (
9
9
globalThis . monorepoPackagePath
10
10
. split ( "/" )
11
11
. filter ( Boolean )
12
12
. map ( ( ) => ".." )
13
13
. join ( "/" ) ,
14
- "../../" ,
14
+ relativePath ,
15
15
) ;
16
16
}
You can’t perform that action at this time.
0 commit comments