@rspack/plugin-react-refresh 1.2.0 → 1.2.1

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.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Compiler } from '@rspack/core';
1
+ import { type Compiler } from '@rspack/core';
2
2
  import type { NormalizedPluginOptions, PluginOptions } from './options';
3
3
  export type { PluginOptions };
4
4
  declare class ReactRefreshRspackPlugin {
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@ const options_1 = require("./options");
7
7
  const paths_1 = require("./paths");
8
8
  const getAdditionalEntries_1 = require("./utils/getAdditionalEntries");
9
9
  const getSocketIntegration_1 = require("./utils/getSocketIntegration");
10
+ const core_1 = require("@rspack/core");
10
11
  const getIntegrationEntry_1 = require("./utils/getIntegrationEntry");
11
12
  function addEntry(entry, compiler) {
12
13
  new compiler.webpack.EntryPlugin(compiler.context, entry, {
@@ -19,6 +20,7 @@ function addSocketEntry(sockIntegration, compiler) {
19
20
  addEntry(integrationEntry, compiler);
20
21
  }
21
22
  }
23
+ const PLUGIN_NAME = 'ReactRefreshRspackPlugin';
22
24
  class ReactRefreshRspackPlugin {
23
25
  constructor(options = {}) {
24
26
  this.options = (0, options_1.normalizeOptions)(options);
@@ -93,6 +95,11 @@ class ReactRefreshRspackPlugin {
93
95
  'react-refresh': refreshPath,
94
96
  ...compiler.options.resolve.alias,
95
97
  };
98
+ compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
99
+ compilation.hooks.additionalTreeRuntimeRequirements.tap(PLUGIN_NAME, (_, runtimeRequirements) => {
100
+ runtimeRequirements.add(core_1.RuntimeGlobals.moduleCache);
101
+ });
102
+ });
96
103
  }
97
104
  }
98
105
  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.1",
4
4
  "repository": "https://github.com/rspack-contrib/rspack-plugin-react-refresh",
5
5
  "license": "MIT",
6
6
  "description": "React refresh plugin for rspack",