From 1c7d1e661c6c5d0179f2c3246f043e76e5f7e18f Mon Sep 17 00:00:00 2001 From: Sora Morimoto Date: Wed, 3 Apr 2024 06:39:28 +0900 Subject: [PATCH] Use `server.hot` instead of deprecated `server.ws` Signed-off-by: Sora Morimoto --- package.json | 2 +- src/index.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 76f0a64..afd2df3 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ }, "peerDependencies": { "rescript": ">=9", - "vite": ">=3" + "vite": ">=5.1.0" }, "packageManager": "pnpm@8.11.0", "engines": { diff --git a/src/index.ts b/src/index.ts index bc455a3..d48d5c3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -122,7 +122,7 @@ export default function createReScriptPlugin(config?: Config): Plugin { (data) => { const log = data.toString(); const err = parseCompilerLog(log); - if (err) server.ws.send({ type: 'error', err }); + if (err) server.hot.send({ type: 'error', err }); } ); }, @@ -195,7 +195,7 @@ export default function createReScriptPlugin(config?: Config): Plugin { } else if (file.endsWith('.compiler.log')) { const log = await read(); const err = parseCompilerLog(log); - if (err) server.ws.send({ type: 'error', err }); + if (err) server.hot.send({ type: 'error', err }); } return;