From 30106e584f0880baa76d47c2a56fe7e0dae70233 Mon Sep 17 00:00:00 2001 From: natemoo-re Date: Thu, 24 Feb 2022 19:12:33 +0000 Subject: [PATCH] [ci] yarn format --- packages/astro/src/runtime/client/hmr.ts | 2 +- packages/astro/src/vite-plugin-astro/hmr.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/astro/src/runtime/client/hmr.ts b/packages/astro/src/runtime/client/hmr.ts index 8bd8d39377..dc9807f049 100644 --- a/packages/astro/src/runtime/client/hmr.ts +++ b/packages/astro/src/runtime/client/hmr.ts @@ -4,7 +4,7 @@ if (import.meta.hot) { const { default: diff } = await import('micromorph'); // eslint-disable-next-line no-console console.log(`[vite] hot updated: ${file}`); - const html = await fetch(`${window.location}`).then(res => res.text()); + const html = await fetch(`${window.location}`).then((res) => res.text()); const doc = parser.parseFromString(html, 'text/html'); // Match incoming islands to current state diff --git a/packages/astro/src/vite-plugin-astro/hmr.ts b/packages/astro/src/vite-plugin-astro/hmr.ts index f69d48cbb1..ceb9a99aba 100644 --- a/packages/astro/src/vite-plugin-astro/hmr.ts +++ b/packages/astro/src/vite-plugin-astro/hmr.ts @@ -3,7 +3,7 @@ import type { LogOptions } from '../core/logger.js'; import type { ViteDevServer, ModuleNode, HmrContext } from 'vite'; import type { PluginContext as RollupPluginContext, ResolvedId } from 'rollup'; import { invalidateCompilation, isCached } from './compile.js'; -import { logger } from '../core/logger.js' +import { logger } from '../core/logger.js'; import { green } from 'kleur/colors'; interface TrackCSSDependenciesOptions { @@ -75,9 +75,9 @@ export function handleHotUpdate(ctx: HmrContext, config: AstroConfig, logging: L if (ctx.file.endsWith('.astro')) { const file = ctx.file.replace(config.projectRoot.pathname, '/'); - logger.info('astro', green('hmr'), `${file}`) - ctx.server.ws.send({ type: "custom", event: "astro:update", data: { file } }) - return [] + logger.info('astro', green('hmr'), `${file}`); + ctx.server.ws.send({ type: 'custom', event: 'astro:update', data: { file } }); + return []; } return Array.from(filtered);