Skip to content

Commit c726906

Browse files
committed
fix compatibility with svelte-loader-hot
1 parent 708838a commit c726906

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/make-hot.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ const renderApplyHmr = ({
8888
// this silly formatting keeps all original characters in their position,
8989
// thus saving us from having to provide a sourcemap
9090
`${imports.join(';')};${`
91-
if (${compatVite ? '' : 'import.meta && '}import.meta.hot) {
91+
if (${compatVite ? '' : `${meta} && `}${meta}.hot) {
9292
$2 = ${globalName}.applyHmr({
9393
m: ${meta},
9494
id: ${quote(id)},

runtime/hot-api.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ function applyHmr(args) {
134134
})
135135

136136
if (canAccept) {
137-
hot.accept(async ({ bubbled } = {}) => {
137+
hot.accept(async arg => {
138+
const { bubbled } = arg || {}
138139
const newCssId = r.current.cssId
139140
const cssChanged = newCssId !== cssId
140141
// ensure old style sheet has been removed by now

0 commit comments

Comments
 (0)