@@ -2,7 +2,7 @@ import { esbuildDecorators } from "@anatine/esbuild-decorators";
2
2
import { build } from "esbuild" ;
3
3
import { readFileSync } from "node:fs" ;
4
4
import { writeFile } from "node:fs/promises" ;
5
- import { basename , join , posix , resolve } from "node:path" ;
5
+ import { basename , join , posix , relative , resolve , sep } from "node:path" ;
6
6
import invariant from "tiny-invariant" ;
7
7
8
8
import {
@@ -145,17 +145,22 @@ export async function compile(options: CompileOptions) {
145
145
logger . debug ( `Writing compiled files to ${ tempDir } ` ) ;
146
146
147
147
// Get the metaOutput for the result build
148
+ const pathsToProjectDir = relative (
149
+ join ( process . cwd ( ) , "e2e" , "fixtures" ) ,
150
+ config . projectDir
151
+ ) . split ( sep ) ;
152
+
148
153
const metaOutput =
149
154
result . metafile ! . outputs [
150
- posix . join ( "e2e" , "fixtures" , basename ( config . projectDir ) , "out" , "stdin.js" )
155
+ posix . join ( "e2e" , "fixtures" , ... pathsToProjectDir , "out" , "stdin.js" )
151
156
] ;
152
157
153
158
invariant ( metaOutput , "Meta output for the result build is missing" ) ;
154
159
155
160
// Get the metaOutput for the entryPoint build
156
161
const entryPointMetaOutput =
157
162
entryPointResult . metafile ! . outputs [
158
- posix . join ( "e2e" , "fixtures" , basename ( config . projectDir ) , "out" , "stdin.js" )
163
+ posix . join ( "e2e" , "fixtures" , ... pathsToProjectDir , "out" , "stdin.js" )
159
164
] ;
160
165
161
166
invariant ( entryPointMetaOutput , "Meta output for the entryPoint build is missing" ) ;
0 commit comments