@rspack/plugin-react-refresh 1.2.0 → 1.2.2

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.
Files changed (2) hide show
  1. package/dist/index.js +6 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -19,6 +19,7 @@ function addSocketEntry(sockIntegration, compiler) {
19
19
  addEntry(integrationEntry, compiler);
20
20
  }
21
21
  }
22
+ const PLUGIN_NAME = 'ReactRefreshRspackPlugin';
22
23
  class ReactRefreshRspackPlugin {
23
24
  constructor(options = {}) {
24
25
  this.options = (0, options_1.normalizeOptions)(options);
@@ -93,6 +94,11 @@ class ReactRefreshRspackPlugin {
93
94
  'react-refresh': refreshPath,
94
95
  ...compiler.options.resolve.alias,
95
96
  };
97
+ compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
98
+ compilation.hooks.additionalTreeRuntimeRequirements.tap(PLUGIN_NAME, (_, runtimeRequirements) => {
99
+ runtimeRequirements.add(compiler.rspack.RuntimeGlobals.moduleCache);
100
+ });
101
+ });
96
102
  }
97
103
  }
98
104
  ReactRefreshRspackPlugin.deprecated_runtimePaths = paths_1.runtimePaths;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/plugin-react-refresh",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "repository": "https://github.com/rspack-contrib/rspack-plugin-react-refresh",
5
5
  "license": "MIT",
6
6
  "description": "React refresh plugin for rspack",