cs
This commit is contained in:
26
node_modules/@ant-design/cssinjs/es/hooks/useHMR.js
generated
vendored
Normal file
26
node_modules/@ant-design/cssinjs/es/hooks/useHMR.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
function useProdHMR() {
|
||||
return false;
|
||||
}
|
||||
var webpackHMR = false;
|
||||
function useDevHMR() {
|
||||
return webpackHMR;
|
||||
}
|
||||
export default process.env.NODE_ENV === 'production' ? useProdHMR : useDevHMR;
|
||||
|
||||
// Webpack `module.hot.accept` do not support any deps update trigger
|
||||
// We have to hack handler to force mark as HRM
|
||||
if (process.env.NODE_ENV !== 'production' && typeof module !== 'undefined' && module && module.hot && typeof window !== 'undefined') {
|
||||
// Use `globalThis` first, and `window` for older browsers
|
||||
// const win = globalThis as any;
|
||||
var win = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : null;
|
||||
if (win && typeof win.webpackHotUpdate === 'function') {
|
||||
var originWebpackHotUpdate = win.webpackHotUpdate;
|
||||
win.webpackHotUpdate = function () {
|
||||
webpackHMR = true;
|
||||
setTimeout(function () {
|
||||
webpackHMR = false;
|
||||
}, 0);
|
||||
return originWebpackHotUpdate.apply(void 0, arguments);
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user