Skip to content

Commit

Permalink
fix(hmr): re-resolve script after type dep changed
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Nov 26, 2024
1 parent 2b27e15 commit 0f2d3eb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { EXPORT_HELPER_ID, helperCode } from '../core/helper'
import { transformMain } from '../core/main'
import {
clearScriptCache,
getResolvedScript,
resolveScript,
typeDepToSFCMap,
} from '../core/script'
import { transformStyle } from '../core/style'
Expand Down Expand Up @@ -349,7 +349,13 @@ export const plugin = createUnplugin<Options | undefined, false>(
let block: SFCBlock | null | undefined
if (query.type === 'script') {
// handle <script> + <script setup> merge via compileScript()
block = getResolvedScript(descriptor, ssr)
block = resolveScript(
meta.framework,
descriptor,
options.value,
ssr,
customElementFilter.value(filename),
)
} else if (query.type === 'template') {
block = descriptor.template!
} else if (query.type === 'style') {
Expand Down

0 comments on commit 0f2d3eb

Please sign in to comment.