Browse Source

fix(dashboard): Clear temp dir on compilation

Michael Bromley 4 months ago
parent
commit
a0bbe09895
1 changed files with 3 additions and 0 deletions
  1. 3 0
      packages/dashboard/vite/utils/compiler.ts

+ 3 - 0
packages/dashboard/vite/utils/compiler.ts

@@ -47,6 +47,9 @@ export async function compile(options: CompilerOptions): Promise<CompileResult>
     const transformTsConfigPathMappings =
     const transformTsConfigPathMappings =
         pathAdapter?.transformTsConfigPathMappings ?? defaultPathAdapter.transformTsConfigPathMappings;
         pathAdapter?.transformTsConfigPathMappings ?? defaultPathAdapter.transformTsConfigPathMappings;
 
 
+    // 0. Clear the outputPath
+    fs.removeSync(outputPath);
+
     // 1. Compile TypeScript files
     // 1. Compile TypeScript files
     const compileStart = Date.now();
     const compileStart = Date.now();
     await compileTypeScript({
     await compileTypeScript({