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";
22import path from "node:path" ;
33
44import type { IncrementalCache } from "types/overrides.js" ;
5- import { getOutputDir } from "utils/normalize-path" ;
5+ import { getMonorepoRelativePath } from "utils/normalize-path" ;
66
77const buildId = process . env . NEXT_BUILD_ID ;
8- const basePath = path . join ( getOutputDir ( ) , `cache/${ buildId } ` ) ;
8+ const basePath = path . join ( getMonorepoRelativePath ( ) , `cache/${ buildId } ` ) ;
99
1010const getCacheKey = ( key : string ) => {
1111 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";
22import path from "node:path" ;
33
44import type { TagCache } from "types/overrides" ;
5- import { getOutputDir } from "utils/normalize-path" ;
5+ import { getMonorepoRelativePath } from "utils/normalize-path" ;
66
77const tagFile = path . join (
8- getOutputDir ( ) ,
8+ getMonorepoRelativePath ( ) ,
99 "dynamodb-provider/dynamodb-cache.json" ,
1010) ;
1111const tagContent = fs . readFileSync ( tagFile , "utf-8" ) ;
Original file line number Diff line number Diff line change @@ -3,15 +3,15 @@ import express from "express";
33
44import type { StreamCreator } from "types/open-next.js" ;
55import type { WrapperHandler } from "types/overrides.js" ;
6- import { getOutputDir } from "utils/normalize-path" ;
6+ import { getMonorepoRelativePath } from "utils/normalize-path" ;
77
88const wrapper : WrapperHandler = async ( handler , converter ) => {
99 const app = express ( ) ;
1010 // To serve static assets
11- app . use ( express . static ( path . join ( getOutputDir ( ) , "assets" ) ) ) ;
11+ app . use ( express . static ( path . join ( getMonorepoRelativePath ( ) , "assets" ) ) ) ;
1212
1313 const imageHandlerPath = path . join (
14- getOutputDir ( ) ,
14+ getMonorepoRelativePath ( ) ,
1515 "image-optimization-function/index.mjs" ,
1616 ) ;
1717
Original file line number Diff line number Diff line change @@ -4,13 +4,13 @@ export function normalizePath(path: string) {
44 return path . replace ( / \\ / g, "/" ) ;
55}
66
7- export function getOutputDir ( ) {
7+ export function getMonorepoRelativePath ( relativePath = "../../" ) : string {
88 return path . join (
99 globalThis . monorepoPackagePath
1010 . split ( "/" )
1111 . filter ( Boolean )
1212 . map ( ( ) => ".." )
1313 . join ( "/" ) ,
14- "../../" ,
14+ relativePath ,
1515 ) ;
1616}
You can’t perform that action at this time.
0 commit comments