Skip to content

Commit 4a02fb6

Browse files
authored
chore: switch to compiler.rspack (#61)
1 parent 5de98ca commit 4a02fb6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
export type { PluginOptions };
1818

1919
function addEntry(entry: string, compiler: Compiler) {
20-
new compiler.webpack.EntryPlugin(compiler.context, entry, {
20+
new compiler.rspack.EntryPlugin(compiler.context, entry, {
2121
name: undefined,
2222
}).apply(compiler);
2323
}
@@ -83,7 +83,7 @@ class ReactRefreshRspackPlugin {
8383
addEntry(entry, compiler);
8484
}
8585

86-
new compiler.webpack.ProvidePlugin({
86+
new compiler.rspack.ProvidePlugin({
8787
$ReactRefreshRuntime$: reactRefreshPath,
8888
}).apply(compiler);
8989

@@ -111,7 +111,7 @@ class ReactRefreshRspackPlugin {
111111
const definedModules: Record<string, string | boolean> = {
112112
// For Multiple Instance Mode
113113
__react_refresh_library__: JSON.stringify(
114-
compiler.webpack.Template.toIdentifier(
114+
compiler.rspack.Template.toIdentifier(
115115
this.options.library ||
116116
compiler.options.output.uniqueName ||
117117
compiler.options.output.library,
@@ -139,8 +139,8 @@ class ReactRefreshRspackPlugin {
139139
);
140140
}
141141
}
142-
new compiler.webpack.DefinePlugin(definedModules).apply(compiler);
143-
new compiler.webpack.ProvidePlugin(providedModules).apply(compiler);
142+
new compiler.rspack.DefinePlugin(definedModules).apply(compiler);
143+
new compiler.rspack.ProvidePlugin(providedModules).apply(compiler);
144144

145145
compiler.options.resolve.alias = {
146146
'react-refresh': getRefreshRuntimeDirPath(),

0 commit comments

Comments
 (0)