@rspack/plugin-react-refresh
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -10,2 +10,14 @@ "use strict"; | ||
const getSocketIntegration_1 = require("./utils/getSocketIntegration"); | ||
const getIntegrationEntry_1 = require("./utils/getIntegrationEntry"); | ||
function addEntry(entry, compiler) { | ||
new compiler.webpack.EntryPlugin(compiler.context, entry, { | ||
name: undefined, | ||
}).apply(compiler); | ||
} | ||
function addSocketEntry(sockIntegration, compiler) { | ||
const integrationEntry = (0, getIntegrationEntry_1.getIntegrationEntry)(sockIntegration); | ||
if (integrationEntry) { | ||
addEntry(integrationEntry, compiler); | ||
} | ||
} | ||
class ReactRefreshRspackPlugin { | ||
@@ -31,10 +43,10 @@ constructor(options = {}) { | ||
for (const entry of addEntries.prependEntries) { | ||
new compiler.webpack.EntryPlugin(compiler.context, entry, { | ||
name: undefined, | ||
}).apply(compiler); | ||
addEntry(entry, compiler); | ||
} | ||
if (this.options.overlay !== false && | ||
this.options.overlay.sockIntegration) { | ||
addSocketEntry(this.options.overlay.sockIntegration, compiler); | ||
} | ||
for (const entry of addEntries.overlayEntries) { | ||
new compiler.webpack.EntryPlugin(compiler.context, entry, { | ||
name: undefined, | ||
}).apply(compiler); | ||
addEntry(entry, compiler); | ||
} | ||
@@ -41,0 +53,0 @@ new compiler.webpack.ProvidePlugin({ |
@@ -6,3 +6,3 @@ import type { RuleSetCondition } from '@rspack/core'; | ||
module: string; | ||
sockIntegration: IntegrationType; | ||
sockIntegration: IntegrationType | false; | ||
sockHost?: string; | ||
@@ -9,0 +9,0 @@ sockPath?: string; |
@@ -1,2 +0,2 @@ | ||
export type IntegrationType = 'wds'; | ||
export type IntegrationType = 'wds' | 'whm' | (string & {}); | ||
export declare function getSocketIntegration(integrationType: IntegrationType): string; |
@@ -11,2 +11,6 @@ "use strict"; | ||
} | ||
case 'whm': { | ||
resolvedSocketIntegration = require.resolve('../sockets/WHMEventSource'); | ||
break; | ||
} | ||
default: { | ||
@@ -13,0 +17,0 @@ resolvedSocketIntegration = require.resolve(integrationType); |
{ | ||
"name": "@rspack/plugin-react-refresh", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"repository": "https://github.com/rspack-contrib/rspack-plugin-react-refresh", | ||
@@ -33,5 +33,4 @@ "license": "MIT", | ||
"@rspack/core": "1.1.4", | ||
"@types/jest": "29.5.14", | ||
"@types/node": "^22.10.1", | ||
"@types/jest": "29.5.14", | ||
"react-refresh": "^0.14.2", | ||
"cross-env": "^7.0.3", | ||
@@ -44,5 +43,7 @@ "execa": "9.5.1", | ||
"nano-staged": "^0.8.0", | ||
"react-refresh": "^0.14.2", | ||
"semver": "7.6.3", | ||
"simple-git-hooks": "^2.11.1", | ||
"ts-jest": "29.2.5", | ||
"ts-node": "^10.9.2", | ||
"typescript": "5.7.2" | ||
@@ -52,9 +53,11 @@ }, | ||
"error-stack-parser": "^2.1.4", | ||
"html-entities": "^2.5.2" | ||
"html-entities": "^2.5.2", | ||
"@continuous-auth/client": "2.3.2" | ||
}, | ||
"peerDependencies": { | ||
"react-refresh": ">=0.10.0 <1.0.0" | ||
"react-refresh": ">=0.10.0 <1.0.0", | ||
"webpack-hot-middleware": "2.x" | ||
}, | ||
"peerDependenciesMeta": { | ||
"react-refresh": { | ||
"webpack-hot-middleware": { | ||
"optional": true | ||
@@ -61,0 +64,0 @@ } |
@@ -149,2 +149,4 @@ <picture> | ||
Checkout [OverlayOptions](https://github.com/rspack-contrib/rspack-plugin-react-refresh/blob/main/src/options.ts#L4) type signature for more details. | ||
- Enable the error overlay: | ||
@@ -151,0 +153,0 @@ |
90953
46
2413
176
5
17
+ Added@continuous-auth/client@2.3.2(transitive)
+ Addedansi-html-community@0.0.8(transitive)
+ Addedansi-regex@5.0.1(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaxios@1.7.9(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedfollow-redirects@1.15.9(transitive)
+ Addedform-data@4.0.1(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedproxy-from-env@1.1.0(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedwebpack-hot-middleware@2.26.1(transitive)