From 7be586206cfe2f5eb62082a2975531e1f06b460e Mon Sep 17 00:00:00 2001 From: OneNail <31649110+OneNail@users.noreply.github.com> Date: Wed, 21 Jul 2021 04:06:28 +0800 Subject: [PATCH] fix: reuse the old preprocessor after changing the lang attr (#4224) * fix(plugin-vue): reuse the old preprocessor after changing the lang attr * feat(playground): add stylus + change lang test in vue * chore: add eol line break Co-authored-by: Shinigami --- packages/plugin-vue/src/handleHotUpdate.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/plugin-vue/src/handleHotUpdate.ts b/packages/plugin-vue/src/handleHotUpdate.ts index ae07de16..fd1275f4 100644 --- a/packages/plugin-vue/src/handleHotUpdate.ts +++ b/packages/plugin-vue/src/handleHotUpdate.ts @@ -88,7 +88,11 @@ export async function handleHotUpdate({ const next = nextStyles[i] if (!prev || !isEqualBlock(prev, next)) { didUpdateStyle = true - const mod = modules.find((m) => m.url.includes(`type=style&index=${i}`)) + const mod = modules.find( + (m) => + m.url.includes(`type=style&index=${i}`) && + m.url.endsWith(`.${next.lang || 'css'}`) + ) if (mod) { affectedModules.add(mod) } else {