Skip to content

Commit

Permalink
fix: reuse the old preprocessor after changing the lang attr (#4224)
Browse files Browse the repository at this point in the history
* 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 <chrissi92@hotmail.de>
  • Loading branch information
y1d7ng and Shinigami92 authored Jul 20, 2021
1 parent f60927d commit 7be5862
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/plugin-vue/src/handleHotUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 7be5862

Please sign in to comment.