vitrify 0.11.9 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin/cli.js CHANGED
@@ -71,12 +71,17 @@ cli
71
71
  ...args,
72
72
  outDir: fileURLToPath(new URL('ssr/server/', baseOutDir))
73
73
  });
74
- ({ prerender, onRendered } = await import(fileURLToPath(new URL('ssr/server/prerender.mjs', baseOutDir))));
74
+ ({ prerender, onRendered } = await import(
75
+ // @ts-ignore
76
+ new URL('ssr/server/prerender.mjs', baseOutDir)));
77
+ // ;({ prerender, onRendered } = await import(
78
+ // fileURLToPath(new URL('ssr/server/prerender.mjs', baseOutDir))
79
+ // ))
75
80
  prerender({
76
81
  outDir: fileURLToPath(new URL('static/', baseOutDir)),
77
82
  templatePath: fileURLToPath(new URL('static/index.html', baseOutDir)),
78
83
  manifestPath: fileURLToPath(new URL('static/ssr-manifest.json', baseOutDir)),
79
- entryServerPath: fileURLToPath(new URL('ssr/server/entry-server.mjs', baseOutDir)),
84
+ entryServerPath: new URL('ssr/server/entry-server.mjs', baseOutDir),
80
85
  onRendered
81
86
  });
82
87
  break;
@@ -90,23 +95,18 @@ cli
90
95
  .option('-m, --mode [mode]', 'Development server mode', { default: 'csr' })
91
96
  .option('--host [host]', 'Specify which IP addresses the server should listen on', { default: '127.0.0.1' })
92
97
  .option('--appDir [appDir]', 'Application directory')
93
- .option('--app [app]', 'Fastify app instance path')
98
+ // .option('--app [app]', 'Fastify app instance path')
94
99
  .option('--publicDir [publicDir]', 'Public directory')
95
100
  .action(async (options) => {
96
101
  let server;
97
102
  let config;
103
+ let vite;
98
104
  if (options.host === true) {
99
105
  options.host = '0.0.0.0';
100
106
  }
101
107
  const { createServer } = await import('./dev.js');
102
108
  const cwd = (await import('../app-urls.js')).getCwd();
103
109
  let app;
104
- const appURL = parsePath(options.app, cwd);
105
- let appPath;
106
- if (appURL) {
107
- appPath = fileURLToPath(appURL);
108
- app = await import(appPath);
109
- }
110
110
  switch (options.mode) {
111
111
  case 'ssr':
112
112
  ;
@@ -119,7 +119,7 @@ cli
119
119
  break;
120
120
  case 'fastify':
121
121
  ;
122
- ({ server, config } = await createServer({
122
+ ({ app, server, config, vite } = await createServer({
123
123
  ssr: 'fastify',
124
124
  host: options.host,
125
125
  appDir: parsePath(options.appDir, cwd),
package/dist/bin/dev.js CHANGED
@@ -78,20 +78,23 @@ ssr, framework = 'vue', host, appDir, publicDir, base }) {
78
78
  }
79
79
  export async function createServer({ port = 3000, logLevel = 'info',
80
80
  // mode = 'csr',
81
- ssr, framework = 'vue', host, appDir, publicDir }) {
81
+ ssr, framework = 'vue', host, appDir, publicDir, vite }) {
82
82
  const { getAppDir, getCliDir, getCliViteDir, getCwd } = await import('../app-urls.js');
83
83
  appDir = appDir || getAppDir();
84
84
  const cliDir = getCliDir();
85
- const vite = await createVitrifyDevServer({
86
- port,
87
- logLevel,
88
- ssr,
89
- framework,
90
- host,
91
- appDir,
92
- publicDir
93
- });
85
+ if (!vite) {
86
+ vite = await createVitrifyDevServer({
87
+ port,
88
+ logLevel,
89
+ ssr,
90
+ framework,
91
+ host,
92
+ appDir,
93
+ publicDir
94
+ });
95
+ }
94
96
  let setup;
97
+ let app;
95
98
  let server;
96
99
  let onRendered;
97
100
  let vitrifyConfig;
@@ -101,7 +104,7 @@ ssr, framework = 'vue', host, appDir, publicDir }) {
101
104
  ? fileURLToPath(new URL('src/vite/fastify/entry.ts', cliDir))
102
105
  : fileURLToPath(new URL(`src/vite/${framework}/ssr/app.ts`, cliDir));
103
106
  ({ setup, onRendered, vitrifyConfig } = await vite.ssrLoadModule(entryUrl));
104
- const app = fastify({
107
+ app = fastify({
105
108
  logger: {
106
109
  level: process.env.DEBUG
107
110
  ? 'debug'
@@ -130,9 +133,23 @@ ssr, framework = 'vue', host, appDir, publicDir }) {
130
133
  host
131
134
  });
132
135
  server = app.server;
136
+ if (ssr === 'fastify') {
137
+ vite.fastifyRestart = async function () {
138
+ if (vite && app && (await app.ready())) {
139
+ await app.close();
140
+ ({ app, server } = await createServer({
141
+ ssr: 'fastify',
142
+ host: host,
143
+ appDir,
144
+ publicDir,
145
+ vite
146
+ }));
147
+ }
148
+ };
149
+ }
133
150
  }
134
151
  else {
135
152
  server = (await vite.listen()).httpServer;
136
153
  }
137
- return { server, config: vite.config };
154
+ return { app, server, config: vite.config, vite };
138
155
  }
package/dist/index.js CHANGED
@@ -157,6 +157,7 @@ export const baseConfig = async ({ ssr, appDir, publicDir, base = '/', command =
157
157
  const fastifyDir = new URL('fastify/', cliViteDir);
158
158
  if (!publicDir)
159
159
  publicDir = new URL('public/', appDir);
160
+ let rawVitrifyConfig;
160
161
  let vitrifyConfig;
161
162
  try {
162
163
  if (fs.existsSync(fileURLToPath(new URL('vitrify.config.ts', appDir)))) {
@@ -164,21 +165,23 @@ export const baseConfig = async ({ ssr, appDir, publicDir, base = '/', command =
164
165
  const bundledConfig = await bundleConfigFile(fileURLToPath(new URL('vitrify.config.ts', appDir)));
165
166
  fs.writeFileSync(configPath + '.js', bundledConfig.code);
166
167
  // @ts-ignore
167
- vitrifyConfig = (await import('file://' + configPath + '.js')).default;
168
+ rawVitrifyConfig = (await import('file://' + configPath + '.js')).default;
168
169
  // vitrifyConfig = (await import(configPath + '.js')).default
169
170
  fs.unlinkSync(configPath + '.js');
170
171
  }
171
172
  else {
172
- vitrifyConfig = (await import(fileURLToPath(new URL('vitrify.config.js', appDir)))).default;
173
+ rawVitrifyConfig = (await import(fileURLToPath(new URL('vitrify.config.js', appDir)))).default;
174
+ }
175
+ if (typeof rawVitrifyConfig === 'function') {
176
+ vitrifyConfig = await rawVitrifyConfig({ mode, command });
177
+ }
178
+ else {
179
+ vitrifyConfig = rawVitrifyConfig;
173
180
  }
174
- if (typeof vitrifyConfig === 'function')
175
- vitrifyConfig = await vitrifyConfig({ mode, command });
176
181
  }
177
182
  catch (e) {
178
- console.log('No vitrify.config.(ts|js) file found, using defaults');
179
- if (process.env.DEBUG)
180
- console.error(e);
181
- vitrifyConfig = {};
183
+ console.log('No valid vitrify.config.(ts|js) file found.');
184
+ throw e;
182
185
  }
183
186
  const localPackages = ['vue', 'vue-router', '@vue/server-renderer'];
184
187
  // const localPackages: string[] = []
@@ -281,6 +284,10 @@ export const baseConfig = async ({ ssr, appDir, publicDir, base = '/', command =
281
284
  globalSass = config.vitrify?.sass?.global || [];
282
285
  return;
283
286
  },
287
+ async handleHotUpdate({ server }) {
288
+ if (server.fastifyRestart)
289
+ await server.fastifyRestart();
290
+ },
284
291
  configureServer(server) {
285
292
  server.middlewares.use('/', (req, res, next) => {
286
293
  if (req.url?.endsWith('.html'))
@@ -1,6 +1,13 @@
1
1
  /// <reference types="node" />
2
- import type { LogLevel, InlineConfig } from 'vite';
2
+ /// <reference types="node" />
3
+ import type { LogLevel, InlineConfig, ViteDevServer } from 'vite';
3
4
  import type { Server } from 'net';
5
+ import type { FastifyInstance } from 'fastify';
6
+ declare module 'vite' {
7
+ interface ViteDevServer {
8
+ fastifyRestart: () => Promise<void>;
9
+ }
10
+ }
4
11
  export declare function createVitrifyDevServer({ port, logLevel, ssr, framework, host, appDir, publicDir, base }: {
5
12
  port?: number;
6
13
  logLevel?: LogLevel;
@@ -10,8 +17,8 @@ export declare function createVitrifyDevServer({ port, logLevel, ssr, framework,
10
17
  appDir?: URL;
11
18
  publicDir?: URL;
12
19
  base?: string;
13
- }): Promise<import("vite").ViteDevServer>;
14
- export declare function createServer({ port, logLevel, ssr, framework, host, appDir, publicDir }: {
20
+ }): Promise<ViteDevServer>;
21
+ export declare function createServer({ port, logLevel, ssr, framework, host, appDir, publicDir, vite }: {
15
22
  port?: number;
16
23
  logLevel?: LogLevel;
17
24
  ssr?: 'ssr' | 'fastify';
@@ -19,7 +26,9 @@ export declare function createServer({ port, logLevel, ssr, framework, host, app
19
26
  host?: string;
20
27
  appDir?: URL;
21
28
  publicDir?: URL;
29
+ vite?: ViteDevServer;
22
30
  }): Promise<{
31
+ app: FastifyInstance<import("fastify").RawServerDefault, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, import("fastify").FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault> | undefined;
23
32
  server: Server;
24
33
  config: Readonly<Omit<import("vite").UserConfig, "plugins" | "assetsInclude" | "optimizeDeps" | "worker"> & {
25
34
  configFile: string | undefined;
@@ -33,11 +42,13 @@ export declare function createServer({ port, logLevel, ssr, framework, host, app
33
42
  mode: string;
34
43
  isWorker: boolean;
35
44
  isProduction: boolean;
45
+ envDir: string;
36
46
  env: Record<string, any>;
37
47
  resolve: Required<import("vite").ResolveOptions> & {
38
48
  alias: import("vite").Alias[];
39
49
  };
40
50
  plugins: readonly import("vite").Plugin[];
51
+ esbuild: false | import("vite").ESBuildOptions;
41
52
  server: import("vite").ResolvedServerOptions;
42
53
  build: import("vite").ResolvedBuildOptions;
43
54
  preview: import("vite").ResolvedPreviewOptions;
@@ -50,4 +61,5 @@ export declare function createServer({ port, logLevel, ssr, framework, host, app
50
61
  appType: import("vite").AppType;
51
62
  experimental: import("vite").ExperimentalOptions;
52
63
  } & import("vite").PluginHookUtils>;
64
+ vite: ViteDevServer;
53
65
  }>;
@@ -11,4 +11,4 @@ export declare const createApp: ({ onSetup, appDir, baseUrl, fastifyPlugin, onRe
11
11
  onRendered: OnRenderedHook[];
12
12
  vitrifyDir?: URL | undefined;
13
13
  mode: string;
14
- }) => FastifyInstance<import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, any, import("fastify").FastifyTypeProviderDefault> & PromiseLike<FastifyInstance<import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, any, import("fastify").FastifyTypeProviderDefault>>;
14
+ }) => FastifyInstance<import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, import("fastify").FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault> & PromiseLike<FastifyInstance<import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, import("fastify").FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitrify",
3
- "version": "0.11.9",
3
+ "version": "0.12.0",
4
4
  "license": "MIT",
5
5
  "author": "Stefan van Herwijnen",
6
6
  "description": "Vite as your Full Stack development tool",
@@ -48,41 +48,41 @@
48
48
  "test": "vitest test/"
49
49
  },
50
50
  "dependencies": {
51
- "@fastify/middie": "^8.1.0",
52
- "@fastify/static": "^6.9.0",
53
- "@quasar/extras": "^1.15.11",
54
- "@vitejs/plugin-vue": "^4.0.0",
51
+ "@fastify/middie": "^8.2.0",
52
+ "@fastify/static": "^6.10.1",
53
+ "@quasar/extras": "^1.16.3",
54
+ "@vitejs/plugin-vue": "^4.2.1",
55
55
  "ajv": "^8.12.0",
56
56
  "builtin-modules": "^3.3.0",
57
57
  "cac": "^6.7.14",
58
58
  "chalk": "^5.2.0",
59
59
  "critters": "^0.0.16",
60
60
  "cross-env": "^7.0.3",
61
- "esbuild": "^0.17.8",
62
- "fastify": "^4.13.0",
63
- "glob": "^8.1.0",
64
- "happy-dom": "^8.4.0",
61
+ "esbuild": "^0.17.18",
62
+ "fastify": "^4.17.0",
63
+ "glob": "^10.2.2",
64
+ "happy-dom": "^9.10.7",
65
65
  "is-port-reachable": "^4.0.0",
66
- "magic-string": "^0.29.0",
66
+ "magic-string": "^0.30.0",
67
67
  "merge-deep": "^3.0.3",
68
68
  "readline": "^1.3.0",
69
69
  "rollup-plugin-visualizer": "^5.9.0",
70
- "sass": "1.58.1",
70
+ "sass": "1.62.1",
71
71
  "ts-node": "^10.9.1",
72
- "unplugin-vue-components": "^0.23.0",
73
- "vite": "^4.1.1",
74
- "vitest": "^0.28.5"
72
+ "unplugin-vue-components": "^0.24.1",
73
+ "vite": "^4.3.4",
74
+ "vitest": "^0.30.1"
75
75
  },
76
76
  "devDependencies": {
77
77
  "@types/connect": "^3.4.35",
78
- "@types/glob": "^8.0.1",
78
+ "@types/glob": "^8.1.0",
79
79
  "@types/merge-deep": "^3.0.0",
80
- "@types/node": "^18.13.0",
80
+ "@types/node": "^18.16.3",
81
81
  "@types/ws": "^8.5.4",
82
82
  "@vue/runtime-core": "^3.2.47",
83
- "quasar": "^2.11.6",
84
- "rollup": "^3.15.0",
85
- "typescript": "^4.9.5",
83
+ "quasar": "^2.11.10",
84
+ "rollup": "^3.21.3",
85
+ "typescript": "^5.0.4",
86
86
  "vue": "^3.2.47",
87
87
  "vue-router": "^4.1.6"
88
88
  },
@@ -3,8 +3,9 @@ import cac from 'cac'
3
3
  import { fileURLToPath } from 'url'
4
4
  import { getAppDir, parsePath } from '../app-urls.js'
5
5
  import { printHttpServerUrls, exitLogs } from '../helpers/logger.js'
6
- import type { ResolvedConfig } from 'vite'
6
+ import type { ResolvedConfig, ViteDevServer } from 'vite'
7
7
  import type { Server } from 'net'
8
+ import type { FastifyInstance } from 'fastify'
8
9
 
9
10
  const cli = cac('vitrify')
10
11
  cli
@@ -83,18 +84,21 @@ cli
83
84
  outDir: fileURLToPath(new URL('ssr/server/', baseOutDir))
84
85
  })
85
86
  ;({ prerender, onRendered } = await import(
86
- fileURLToPath(new URL('ssr/server/prerender.mjs', baseOutDir))
87
+ // @ts-ignore
88
+ new URL('ssr/server/prerender.mjs', baseOutDir)
87
89
  ))
88
90
 
91
+ // ;({ prerender, onRendered } = await import(
92
+ // fileURLToPath(new URL('ssr/server/prerender.mjs', baseOutDir))
93
+ // ))
94
+
89
95
  prerender({
90
96
  outDir: fileURLToPath(new URL('static/', baseOutDir)),
91
97
  templatePath: fileURLToPath(new URL('static/index.html', baseOutDir)),
92
98
  manifestPath: fileURLToPath(
93
99
  new URL('static/ssr-manifest.json', baseOutDir)
94
100
  ),
95
- entryServerPath: fileURLToPath(
96
- new URL('ssr/server/entry-server.mjs', baseOutDir)
97
- ),
101
+ entryServerPath: new URL('ssr/server/entry-server.mjs', baseOutDir),
98
102
  onRendered
99
103
  })
100
104
  break
@@ -113,23 +117,18 @@ cli
113
117
  { default: '127.0.0.1' }
114
118
  )
115
119
  .option('--appDir [appDir]', 'Application directory')
116
- .option('--app [app]', 'Fastify app instance path')
120
+ // .option('--app [app]', 'Fastify app instance path')
117
121
  .option('--publicDir [publicDir]', 'Public directory')
118
122
  .action(async (options) => {
119
123
  let server: Server
120
124
  let config: ResolvedConfig
125
+ let vite: ViteDevServer
121
126
  if (options.host === true) {
122
127
  options.host = '0.0.0.0'
123
128
  }
124
129
  const { createServer } = await import('./dev.js')
125
130
  const cwd = (await import('../app-urls.js')).getCwd()
126
- let app
127
- const appURL = parsePath(options.app, cwd)
128
- let appPath: string
129
- if (appURL) {
130
- appPath = fileURLToPath(appURL)
131
- app = await import(appPath)
132
- }
131
+ let app: FastifyInstance | undefined
133
132
 
134
133
  switch (options.mode) {
135
134
  case 'ssr':
@@ -141,7 +140,7 @@ cli
141
140
  }))
142
141
  break
143
142
  case 'fastify':
144
- ;({ server, config } = await createServer({
143
+ ;({ app, server, config, vite } = await createServer({
145
144
  ssr: 'fastify',
146
145
  host: options.host,
147
146
  appDir: parsePath(options.appDir, cwd),
@@ -1,4 +1,4 @@
1
- import type { LogLevel, InlineConfig } from 'vite'
1
+ import type { LogLevel, InlineConfig, ViteDevServer } from 'vite'
2
2
  import { searchForWorkspaceRoot } from 'vite'
3
3
  import { baseConfig } from '../index.js'
4
4
  import type { Server } from 'net'
@@ -9,6 +9,13 @@ import type { OnRenderedHook, VitrifyConfig } from '../vitrify-config.js'
9
9
  import isPortReachable from 'is-port-reachable'
10
10
  import { exitLogs } from '../helpers/logger.js'
11
11
  import { fileURLToPath } from 'url'
12
+ import type { FastifyInstance } from 'fastify'
13
+
14
+ declare module 'vite' {
15
+ interface ViteDevServer {
16
+ fastifyRestart: () => Promise<void>
17
+ }
18
+ }
12
19
 
13
20
  const getFirstOpenPort = async (portNumber: number): Promise<number> => {
14
21
  if (!(await isPortReachable(portNumber, { host: 'localhost' }))) {
@@ -118,7 +125,8 @@ export async function createServer({
118
125
  framework = 'vue',
119
126
  host,
120
127
  appDir,
121
- publicDir
128
+ publicDir,
129
+ vite
122
130
  }: {
123
131
  port?: number
124
132
  logLevel?: LogLevel
@@ -128,6 +136,7 @@ export async function createServer({
128
136
  host?: string
129
137
  appDir?: URL
130
138
  publicDir?: URL
139
+ vite?: ViteDevServer
131
140
  }) {
132
141
  const { getAppDir, getCliDir, getCliViteDir, getCwd } = await import(
133
142
  '../app-urls.js'
@@ -136,17 +145,20 @@ export async function createServer({
136
145
  appDir = appDir || getAppDir()
137
146
  const cliDir = getCliDir()
138
147
 
139
- const vite = await createVitrifyDevServer({
140
- port,
141
- logLevel,
142
- ssr,
143
- framework,
144
- host,
145
- appDir,
146
- publicDir
147
- })
148
+ if (!vite) {
149
+ vite = await createVitrifyDevServer({
150
+ port,
151
+ logLevel,
152
+ ssr,
153
+ framework,
154
+ host,
155
+ appDir,
156
+ publicDir
157
+ })
158
+ }
148
159
 
149
160
  let setup
161
+ let app: FastifyInstance | undefined
150
162
  let server: Server
151
163
  let onRendered: OnRenderedHook[]
152
164
  let vitrifyConfig: VitrifyConfig
@@ -159,7 +171,7 @@ export async function createServer({
159
171
  : fileURLToPath(new URL(`src/vite/${framework}/ssr/app.ts`, cliDir))
160
172
 
161
173
  ;({ setup, onRendered, vitrifyConfig } = await vite.ssrLoadModule(entryUrl))
162
- const app = fastify({
174
+ app = fastify({
163
175
  logger: {
164
176
  level: process.env.DEBUG
165
177
  ? 'debug'
@@ -187,8 +199,23 @@ export async function createServer({
187
199
  host
188
200
  })
189
201
  server = app.server
202
+
203
+ if (ssr === 'fastify') {
204
+ vite.fastifyRestart = async function () {
205
+ if (vite && app && (await app.ready())) {
206
+ await app.close()
207
+ ;({ app, server } = await createServer({
208
+ ssr: 'fastify',
209
+ host: host,
210
+ appDir,
211
+ publicDir,
212
+ vite
213
+ }))
214
+ }
215
+ }
216
+ }
190
217
  } else {
191
218
  server = (await vite.listen()).httpServer as Server
192
219
  }
193
- return { server, config: vite.config }
220
+ return { app, server, config: vite.config, vite }
194
221
  }
package/src/node/index.ts CHANGED
@@ -226,7 +226,8 @@ export const baseConfig = async ({
226
226
 
227
227
  if (!publicDir) publicDir = new URL('public/', appDir)
228
228
 
229
- let vitrifyConfig: VitrifyConfig | VitrifyConfigAsync
229
+ let rawVitrifyConfig: VitrifyConfig | VitrifyConfigAsync
230
+ let vitrifyConfig: VitrifyConfig
230
231
 
231
232
  try {
232
233
  if (fs.existsSync(fileURLToPath(new URL('vitrify.config.ts', appDir)))) {
@@ -236,20 +237,22 @@ export const baseConfig = async ({
236
237
  )
237
238
  fs.writeFileSync(configPath + '.js', bundledConfig.code)
238
239
  // @ts-ignore
239
- vitrifyConfig = (await import('file://' + configPath + '.js')).default
240
+ rawVitrifyConfig = (await import('file://' + configPath + '.js')).default
240
241
  // vitrifyConfig = (await import(configPath + '.js')).default
241
242
  fs.unlinkSync(configPath + '.js')
242
243
  } else {
243
- vitrifyConfig = (
244
+ rawVitrifyConfig = (
244
245
  await import(fileURLToPath(new URL('vitrify.config.js', appDir)))
245
246
  ).default
246
247
  }
247
- if (typeof vitrifyConfig === 'function')
248
- vitrifyConfig = await vitrifyConfig({ mode, command })
248
+ if (typeof rawVitrifyConfig === 'function') {
249
+ vitrifyConfig = await rawVitrifyConfig({ mode, command })
250
+ } else {
251
+ vitrifyConfig = rawVitrifyConfig
252
+ }
249
253
  } catch (e) {
250
- console.log('No vitrify.config.(ts|js) file found, using defaults')
251
- if (process.env.DEBUG) console.error(e)
252
- vitrifyConfig = {}
254
+ console.log('No valid vitrify.config.(ts|js) file found.')
255
+ throw e
253
256
  }
254
257
 
255
258
  const localPackages = ['vue', 'vue-router', '@vue/server-renderer']
@@ -366,6 +369,9 @@ export const baseConfig = async ({
366
369
 
367
370
  return
368
371
  },
372
+ async handleHotUpdate({ server }) {
373
+ if (server.fastifyRestart) await server.fastifyRestart()
374
+ },
369
375
  configureServer(server) {
370
376
  server.middlewares.use('/', (req, res, next) => {
371
377
  if (req.url?.endsWith('.html')) req.url = req.url.replace('.html', '')