Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
ClarkXia committed Aug 15, 2023
1 parent 052c2b0 commit 3dbd20b
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions packages/ice/src/bundler/rspack/client/reactRefresh.cts
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ const RefreshRuntime = require('react-refresh/runtime');

// Port from https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/main/loader/utils/getRefreshModuleRuntime.js#L29
function refresh(moduleId, webpackHot) {
const currentExports = RefreshUtils.getModuleExports(moduleId);
const fn = exports => {
RefreshUtils.executeRuntime(exports, moduleId, webpackHot);
};
if (typeof Promise !== "undefined" && currentExports instanceof Promise) {
currentExports.then(fn);
} else {
fn(currentExports);
}
const currentExports = RefreshUtils.getModuleExports(moduleId);
const fn = exports => {
RefreshUtils.executeRuntime(exports, moduleId, webpackHot);
};
if (typeof Promise !== "undefined" && currentExports instanceof Promise) {
currentExports.then(fn);
} else {
fn(currentExports);
}
}

module.exports = {
refresh,
register: RefreshRuntime.register,
createSignatureFunctionForTransform:
RefreshRuntime.createSignatureFunctionForTransform
refresh,
register: RefreshRuntime.register,
createSignatureFunctionForTransform:
RefreshRuntime.createSignatureFunctionForTransform
};

0 comments on commit 3dbd20b

Please sign in to comment.