File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -15,20 +15,26 @@ export default class Server {
15
15
/** @type {Partial<{ mode: "development" | "staging" | "production"; port: number; base: string }> } */
16
16
{ mode, port, base } = { } ,
17
17
) {
18
- /** @type {"development" | "staging" | "production" } */
19
- this . mode = mode || process . env . MODE || "development"
20
- /** @type {number } */
21
- this . port = port || ( process . env . PORT ? Number ( process . env . PORT ) : 5173 )
22
- /** @type {string } */
23
- this . base = base || process . env . BASE || "/"
24
-
25
18
/** @type {boolean } */
26
19
this . envIsProduction = process . env . NODE_ENV === "production"
27
20
/** @type {string } */
28
21
this . templateHtml = ""
29
22
/** @type {string } */
30
23
this . hostname = this . envIsProduction ? "0.0.0.0" : "127.0.0.1"
31
24
25
+ /** @type {"development" | "staging" | "production" } */
26
+ this . mode = mode || process . env . MODE || "development"
27
+ /** @type {number } */
28
+ this . port =
29
+ port ||
30
+ ( process . env . PORT
31
+ ? Number ( process . env . PORT )
32
+ : this . envIsProduction
33
+ ? 8080
34
+ : 5173 )
35
+ /** @type {string } */
36
+ this . base = base || process . env . BASE || "/"
37
+
32
38
/** @type {import('express').Express } */
33
39
this . app = express ( )
34
40
/** @type {import('vite').ViteDevServer | undefined } */
You can’t perform that action at this time.
0 commit comments