fix: conditional classes, dynamic params, HMR and formatter
This commit is contained in:
@@ -218,9 +218,19 @@ export async function startServer(opts: ServeOptions): Promise<RunningServer> {
|
||||
// modules, rescan file routes, and ask browsers to morph in fresh HTML.
|
||||
if (hmr && hub) {
|
||||
const hotUpdate = async (files: string[]): Promise<void> => {
|
||||
for (const relative of files) invalidateModule(resolve(appDir, relative));
|
||||
// Allow VS Code/Bun to finish writing pasted content.
|
||||
await new Promise((resolvePromise) => setTimeout(resolvePromise, 50));
|
||||
|
||||
Object.assign(router, buildRouter(appDir, { componentDirs: [uiComponentsDir()] }));
|
||||
for (const relative of files) {
|
||||
invalidateModule(resolve(appDir, relative));
|
||||
}
|
||||
|
||||
Object.assign(
|
||||
router,
|
||||
buildRouter(appDir, {
|
||||
componentDirs: [uiComponentsDir()],
|
||||
}),
|
||||
);
|
||||
middleware.invalidate();
|
||||
|
||||
if (files.some((file) => file === "schemas" || file.startsWith("schemas/"))) {
|
||||
|
||||
Reference in New Issue
Block a user