Rework SDK watcher (#17305)
This commit is contained in:
@@ -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');
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user