@rspack/plugin-react-refresh 0.3.2-canary-edaf4e2-20230911091522 → 0.3.3-canary-f645a58-20230912041955
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,23 @@
|
|
1
|
+
// Thanks https://github.com/pmmmwh/react-refresh-webpack-plugin
|
2
|
+
const RefreshUtils = require("@pmmmwh/react-refresh-webpack-plugin/lib/runtime/RefreshUtils");
|
3
|
+
const RefreshRuntime = require("react-refresh/runtime");
|
4
|
+
|
5
|
+
// Port from https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/main/loader/utils/getRefreshModuleRuntime.js#L29
|
6
|
+
function refresh(moduleId, webpackHot) {
|
7
|
+
const currentExports = RefreshUtils.getModuleExports(moduleId);
|
8
|
+
const fn = exports => {
|
9
|
+
RefreshUtils.executeRuntime(exports, moduleId, webpackHot);
|
10
|
+
};
|
11
|
+
if (typeof Promise !== "undefined" && currentExports instanceof Promise) {
|
12
|
+
currentExports.then(fn);
|
13
|
+
} else {
|
14
|
+
fn(currentExports);
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
module.exports = {
|
19
|
+
refresh,
|
20
|
+
register: RefreshRuntime.register,
|
21
|
+
createSignatureFunctionForTransform:
|
22
|
+
RefreshRuntime.createSignatureFunctionForTransform
|
23
|
+
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@rspack/plugin-react-refresh",
|
3
|
-
"version": "0.3.
|
3
|
+
"version": "0.3.3-canary-f645a58-20230912041955",
|
4
4
|
"license": "MIT",
|
5
5
|
"description": "React refresh plugin for rspack",
|
6
6
|
"main": "src/index.js",
|
@@ -10,9 +10,12 @@
|
|
10
10
|
"./react-refresh-entry": "./client/reactRefreshEntry.js"
|
11
11
|
},
|
12
12
|
"files": [
|
13
|
+
"client",
|
13
14
|
"src"
|
14
15
|
],
|
15
|
-
"
|
16
|
+
"publishConfig": {
|
17
|
+
"access": "public"
|
18
|
+
},
|
16
19
|
"homepage": "https://rspack.dev",
|
17
20
|
"bugs": "https://github.com/web-infra-dev/rspack/issues",
|
18
21
|
"repository": {
|