1+ import type { Compiler } from '@rspack/core' ;
12import { normalizeOptions } from './options' ;
3+ import type { NormalizedPluginOptions , PluginOptions } from './options' ;
24import {
5+ getRefreshRuntimeDirPath ,
6+ getRefreshRuntimePaths ,
37 reactRefreshPath ,
4- refreshRuntimeDirPath ,
58 refreshUtilsPath ,
6- runtimePaths ,
79} from './paths' ;
810import { getAdditionalEntries } from './utils/getAdditionalEntries' ;
11+ import { getIntegrationEntry } from './utils/getIntegrationEntry' ;
912import {
1013 type IntegrationType ,
1114 getSocketIntegration ,
1215} from './utils/getSocketIntegration' ;
1316
14- import type { Compiler } from '@rspack/core' ;
15- import type { NormalizedPluginOptions , PluginOptions } from './options' ;
16- import { getIntegrationEntry } from './utils/getIntegrationEntry' ;
17-
1817export type { PluginOptions } ;
1918
2019function addEntry ( entry : string , compiler : Compiler ) {
@@ -36,7 +35,13 @@ const PLUGIN_NAME = 'ReactRefreshRspackPlugin';
3635class ReactRefreshRspackPlugin {
3736 options : NormalizedPluginOptions ;
3837
39- static deprecated_runtimePaths = runtimePaths ;
38+ /**
39+ * @deprecated
40+ */
41+ static get deprecated_runtimePaths ( ) {
42+ return getRefreshRuntimePaths ( ) ;
43+ }
44+
4045 static loader = 'builtin:react-refresh-loader' ;
4146
4247 constructor ( options : PluginOptions = { } ) {
@@ -89,7 +94,9 @@ class ReactRefreshRspackPlugin {
8994 include : this . options . include ! ,
9095 exclude : {
9196 // biome-ignore lint: exists
92- or : [ this . options . exclude ! , [ ...runtimePaths ] ] . filter ( Boolean ) ,
97+ or : [ this . options . exclude ! , [ ...getRefreshRuntimePaths ( ) ] ] . filter (
98+ Boolean ,
99+ ) ,
93100 } ,
94101 resourceQuery : this . options . resourceQuery ,
95102 dependency : {
@@ -136,7 +143,7 @@ class ReactRefreshRspackPlugin {
136143 new compiler . webpack . ProvidePlugin ( providedModules ) . apply ( compiler ) ;
137144
138145 compiler . options . resolve . alias = {
139- 'react-refresh' : refreshRuntimeDirPath ,
146+ 'react-refresh' : getRefreshRuntimeDirPath ( ) ,
140147 ...compiler . options . resolve . alias ,
141148 } ;
142149
0 commit comments