Rework SDK watcher (#17305)

This commit is contained in:
Charles Bochet
2026-01-21 16:18:54 +01:00
committed by GitHub
parent 54a9a1087b
commit 5ee6853d7e
20 changed files with 264 additions and 427 deletions
@@ -1,8 +1,6 @@
import path from 'path';
export const computeFunctionOutputPath = (
handlerPath: string,
): { relativePath: string; outputDir: string } => {
): string => {
const normalizedPath = handlerPath.replace(/\\/g, '/');
let relativePath = normalizedPath;
@@ -12,13 +10,5 @@ export const computeFunctionOutputPath = (
relativePath = relativePath.slice('src/'.length);
}
relativePath = relativePath.replace(/\.ts$/, '.js');
const outputDir = path.dirname(relativePath);
const normalizedOutputDir = outputDir === '.' ? '' : outputDir;
return {
relativePath,
outputDir: normalizedOutputDir,
};
return relativePath.replace(/\.ts$/, '.js');
};