Skip to content

Commit

Permalink
fix: typo
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Jun 21, 2024
1 parent 4bb1385 commit f1d6d9c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
16 changes: 5 additions & 11 deletions packages/tiny-refresh/src/transform.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,17 @@ const NotFn = "hello";
import * as $$runtime from "/runtime";
import * as $$refresh from "/refresh-runtime";
if (import.meta.hot) {
() => import.meta.hot.accept();
const $$manager = $$refresh.createManager(
() => import.meta.hot.accept(); // need a fake "accept" for Vite to notice
const $$manager = $$runtime.setupVite(
import.meta.hot,
{
createElement: $$runtime.createElement,
useReducer: $$runtime.useReducer,
useEffect: $$runtime.useEffect,
},
false,
$$runtime,
false
);
FnDefault = $$manager.wrap("FnDefault", FnDefault, "");
FnLet = $$manager.wrap("FnLet", FnLet, "useState/useRef/useCallback");
FnConst = $$manager.wrap("FnConst", FnConst, "");
FnNonExport = $$manager.wrap("FnNonExport", FnNonExport, "");
$$manager.setup();
}
"
}"
`);
});
});
2 changes: 2 additions & 0 deletions packages/tiny-refresh/src/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ if (import.meta.hot) {
${id} = $$manager.wrap("${id}", ${id}, ${JSON.stringify(hooks.join("/"))});
`;
}
footer += `\
}`;
// no need to manipulate sourcemap since transform only appends
return result.outCode + footer;
}
Expand Down

0 comments on commit f1d6d9c

Please sign in to comment.