Skip to content

Commit

Permalink
fix(plugin-vite): start Vite error (#3189)
Browse files Browse the repository at this point in the history
* fix: start Vite error

* fix(plugin-vite): `fs.rm` instead `fs.rmdir`
  • Loading branch information
caoxiemeihao committed Mar 10, 2023
1 parent 98b621d commit 3e6729b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/plugin/vite/src/VitePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default class VitePlugin extends PluginBase<VitePluginConfig> {
prePackage: [
namedHookWithTaskFn<'prePackage'>(async () => {
this.isProd = true;
await fs.rmdir(this.baseDir, { recursive: true });
await fs.rm(this.baseDir, { recursive: true, force: true });

await Promise.all([this.build(), this.buildRenderer()]);
}, 'Building vite bundles'),
Expand All @@ -67,7 +67,7 @@ export default class VitePlugin extends PluginBase<VitePluginConfig> {
if (VitePlugin.alreadyStarted) return false;
VitePlugin.alreadyStarted = true;

await fs.rmdir(this.baseDir, { recursive: true });
await fs.rm(this.baseDir, { recursive: true, force: true });

return {
tasks: [
Expand Down

0 comments on commit 3e6729b

Please sign in to comment.