diff --git a/build/next/index.ts b/build/next/index.ts index 8d8429012de..2d30bbf737a 100644 --- a/build/next/index.ts +++ b/build/next/index.ts @@ -699,11 +699,11 @@ const transformOptions: esbuild.TransformOptions = { }), }; -async function transpileFile(srcPath: string, destPath: string, relativePath: string): Promise { +async function transpileFile(srcPath: string, destPath: string): Promise { const source = await fs.promises.readFile(srcPath, 'utf-8'); const result = await esbuild.transform(source, { ...transformOptions, - sourcefile: relativePath, + sourcefile: srcPath, }); await fs.promises.mkdir(path.dirname(destPath), { recursive: true }); @@ -728,7 +728,7 @@ async function transpile(outDir: string, excludeTests: boolean): Promise { await Promise.all(files.map(file => { const srcPath = path.join(REPO_ROOT, SRC_DIR, file); const destPath = path.join(REPO_ROOT, outDir, file.replace(/\.ts$/, '.js')); - return transpileFile(srcPath, destPath, file); + return transpileFile(srcPath, destPath); })); } @@ -996,7 +996,7 @@ async function watch(): Promise { await Promise.all(tsFiles.map(srcPath => { const relativePath = path.relative(path.join(REPO_ROOT, SRC_DIR), srcPath); const destPath = path.join(REPO_ROOT, outDir, relativePath.replace(/\.ts$/, '.js')); - return transpileFile(srcPath, destPath, relativePath); + return transpileFile(srcPath, destPath); })); }