Skip to content

Commit

Permalink
fix(plugin-vite): correctly close vite dev-server (#3202)
Browse files Browse the repository at this point in the history
  • Loading branch information
caoxiemeihao committed Apr 4, 2023
1 parent 1cb2f99 commit 25bf1ab
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/plugin/vite/src/VitePlugin.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import fs from 'node:fs/promises';
import http from 'node:http';
import path from 'node:path';

import { namedHookWithTaskFn, PluginBase } from '@electron-forge/plugin-base';
Expand Down Expand Up @@ -31,7 +30,7 @@ export default class VitePlugin extends PluginBase<VitePluginConfig> {

private watchers: RollupWatcher[] = [];

private servers: http.Server[] = [];
private servers: vite.ViteDevServer[] = [];

init = (dir: string): void => {
this.setDirectories(dir);
Expand Down Expand Up @@ -131,7 +130,7 @@ export default class VitePlugin extends PluginBase<VitePluginConfig> {
viteDevServer.printUrls();

if (viteDevServer.httpServer) {
this.servers.push(viteDevServer.httpServer);
this.servers.push(viteDevServer);
}
}
};
Expand Down

0 comments on commit 25bf1ab

Please sign in to comment.