UNPKG

@tuax/plugin-react

Version:

support react 18

8 lines (7 loc) 507 B
const wglobal = typeof global === 'undefined' ? window : global; if (typeof wglobal !== 'undefined') { const runtime = require(process.env.reactRefreshRuntimePath); runtime.injectIntoGlobalHook(wglobal); // 执行这句会死在 [HMR] Waiting for update signal from WDS... , 不晓得为什么,这是官方给的用法,不执行也能热更新,奇怪的很, chrome devtool有bug导致的..., 尝试升级浏览器即可 wglobal.$RefreshReg$ = () => { }; wglobal.$RefreshSig$ = () => type => type; }