File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change 1
1
const os = require ( 'os' )
2
- const fs = require ( 'fs' )
2
+ const fs = require ( 'fs-extra ' )
3
3
const path = require ( 'path' )
4
4
const { chromium } = require ( 'playwright-chromium' )
5
5
@@ -14,11 +14,7 @@ module.exports = async () => {
14
14
15
15
global . __BROWSER_SERVER__ = browserServer
16
16
17
- fs . mkdirSync ( DIR , { recursive : true } )
18
- fs . writeFileSync ( path . join ( DIR , 'wsEndpoint' ) , browserServer . wsEndpoint ( ) )
19
-
20
- const fixtureDir = path . resolve ( __dirname , '../temp' )
21
- if ( fs . existsSync ( fixtureDir ) ) {
22
- fs . rmSync ( fixtureDir , { recursive : true } )
23
- }
17
+ await fs . mkdirp ( DIR )
18
+ await fs . writeFile ( path . join ( DIR , 'wsEndpoint' ) , browserServer . wsEndpoint ( ) )
19
+ await fs . remove ( path . resolve ( __dirname , '../temp' ) )
24
20
}
Original file line number Diff line number Diff line change 1
- const fs = require ( 'fs' )
1
+ const fs = require ( 'fs-extra ' )
2
2
const path = require ( 'path' )
3
3
4
4
module . exports = async ( ) => {
5
5
await global . __BROWSER_SERVER__ . close ( )
6
6
if ( ! process . env . VITE_PRESERVE_BUILD_ARTIFACTS ) {
7
- fs . rmSync ( path . resolve ( __dirname , '../temp' ) , { recursive : true } )
7
+ await fs . remove ( path . resolve ( __dirname , '../temp' ) )
8
8
}
9
9
}
You can’t perform that action at this time.
0 commit comments