Closed
Description
Kind of an edge case, but if you're using a component that has been link
ed to your project, it won't be able to resolve hot-api. A plausible fix might be this:
+const resolved = require.resolve('./lib/hot-api');
+
function makeHot(id, code, hotOptions) {
const options = JSON.stringify(hotOptions);
const replacement = `
if (module.hot) {
- const { configure, register, reload } = require('svelte-loader/lib/hot-api');
+ const { configure, register, reload } = require('${resolved}');
module.hot.accept();
if (!module.hot.data) {
// initial load
configure(${options});
$2 = register(${id}, $2);
} else {
// hot update
$2 = reload(${id}, $2);
}
}
export default $2;
`;
Metadata
Metadata
Assignees
Labels
No labels