diff --git a/package.json b/package.json index 872227e..63cf8d3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rspack/plugin-react-refresh", - "version": "1.1.1", + "version": "1.2.0", "repository": "https://github.com/rspack-contrib/rspack-plugin-react-refresh", "license": "MIT", "description": "React refresh plugin for rspack", diff --git a/src/index.ts b/src/index.ts index cf390d0..b6f0f92 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,7 +7,7 @@ import { getSocketIntegration, } from './utils/getSocketIntegration'; -import type { Compiler } from '@rspack/core'; +import { type Compiler, RuntimeGlobals } from '@rspack/core'; import type { NormalizedPluginOptions, PluginOptions } from './options'; import { getIntegrationEntry } from './utils/getIntegrationEntry'; @@ -27,6 +27,8 @@ function addSocketEntry(sockIntegration: IntegrationType, compiler: Compiler) { } } +const PLUGIN_NAME = 'ReactRefreshRspackPlugin'; + class ReactRefreshRspackPlugin { options: NormalizedPluginOptions; @@ -49,6 +51,7 @@ class ReactRefreshRspackPlugin { ) { return; } + const addEntries = getAdditionalEntries({ devServer: compiler.options.devServer, options: this.options, @@ -125,6 +128,15 @@ class ReactRefreshRspackPlugin { 'react-refresh': refreshPath, ...compiler.options.resolve.alias, }; + + compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => { + compilation.hooks.additionalTreeRuntimeRequirements.tap( + PLUGIN_NAME, + (_, runtimeRequirements) => { + runtimeRequirements.add(RuntimeGlobals.moduleCache); + }, + ); + }); } } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy