silverwolf-x/project / packages /react-refresh-utils /ReactRefreshRspackPlugin.ts
silverwolf-x's picture
download
raw
686 Bytes
import type { Compiler } from 'webpack'
const PLUGIN_NAME = 'ReactRefreshRspackPlugin'
class ReactRefreshRspackPlugin {
static loader = 'builtin:react-refresh-loader'
apply(compiler: Compiler) {
new compiler.webpack.ProvidePlugin({
$ReactRefreshRuntime$: require.resolve('./internal/RspackReactRefresh'),
}).apply(compiler)
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
compilation.hooks.additionalTreeRuntimeRequirements.tap(
PLUGIN_NAME,
(_, runtimeRequirements) => {
runtimeRequirements.add(compiler.webpack.RuntimeGlobals.moduleCache)
}
)
})
}
}
export default ReactRefreshRspackPlugin

Xet Storage Details

Size:
686 Bytes
·
Xet hash:
5c3cb3388d1757434164f8af51199334539881b3d9240ca0d086d97c6ae373aa

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.