File tree Expand file tree Collapse file tree 1 file changed +2
-16
lines changed
code/core/src/core-server Expand file tree Collapse file tree 1 file changed +2
-16
lines changed Original file line number Diff line number Diff line change @@ -47,22 +47,8 @@ export async function buildStaticStandalone(options: BuildStaticStandaloneOption
4747 if ( options . outputDir === '/' ) {
4848 throw new Error ( "Won't remove directory '/'. Check your outputDir!" ) ;
4949 }
50-
51- try {
52- const outputDirFiles = await readdir ( options . outputDir ) ;
53- for ( const file of outputDirFiles ) {
54- await rm ( file , { recursive : true , force : true } ) ;
55- }
56- } catch {
57- await mkdir ( options . outputDir , { recursive : true } ) ;
58- }
59-
60- if ( ! existsSync ( options . outputDir ) ) {
61- await mkdir ( options . outputDir , { recursive : true } ) ;
62- } else if ( ( await readdir ( options . outputDir ) ) . length > 0 ) {
63- await rm ( options . outputDir , { recursive : true , force : true } ) ;
64- await mkdir ( options . outputDir , { recursive : true } ) ;
65- }
50+ await rm ( options . outputDir , { recursive : true , force : true } ) . catch ( ( ) => { } ) ;
51+ await mkdir ( options . outputDir , { recursive : true } ) ;
6652
6753 const config = await loadMainConfig ( options ) ;
6854 const { framework } = config ;
You can’t perform that action at this time.
0 commit comments