@rspack/plugin-react-refresh 1.0.3 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +11 -8
- package/dist/options.d.ts +5 -0
- package/dist/options.js +1 -0
- package/package.json +11 -11
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
@@ -51,15 +51,17 @@ class ReactRefreshRspackPlugin {
|
|
51
51
|
new compiler.webpack.ProvidePlugin({
|
52
52
|
$ReactRefreshRuntime$: paths_1.reactRefreshPath,
|
53
53
|
}).apply(compiler);
|
54
|
-
|
55
|
-
|
56
|
-
include: this.options.include,
|
57
|
-
exclude: {
|
54
|
+
if (this.options.injectLoader) {
|
55
|
+
compiler.options.module.rules.unshift({
|
58
56
|
// biome-ignore lint: exists
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
57
|
+
include: this.options.include,
|
58
|
+
exclude: {
|
59
|
+
// biome-ignore lint: exists
|
60
|
+
or: [this.options.exclude, [...paths_1.runtimePaths]].filter(Boolean),
|
61
|
+
},
|
62
|
+
use: ReactRefreshRspackPlugin.loader,
|
63
|
+
});
|
64
|
+
}
|
63
65
|
const definedModules = {
|
64
66
|
// For Multiple Instance Mode
|
65
67
|
__react_refresh_library__: JSON.stringify(compiler.webpack.Template.toIdentifier(this.options.library ||
|
@@ -92,4 +94,5 @@ class ReactRefreshRspackPlugin {
|
|
92
94
|
}
|
93
95
|
}
|
94
96
|
ReactRefreshRspackPlugin.deprecated_runtimePaths = paths_1.runtimePaths;
|
97
|
+
ReactRefreshRspackPlugin.loader = 'builtin:react-refresh-loader';
|
95
98
|
module.exports = ReactRefreshRspackPlugin;
|
package/dist/options.d.ts
CHANGED
@@ -41,6 +41,11 @@ export type PluginOptions = {
|
|
41
41
|
* @default false
|
42
42
|
*/
|
43
43
|
overlay?: boolean | Partial<OverlayOptions>;
|
44
|
+
/**
|
45
|
+
* Whether to inject the builtin:react-refresh-loader
|
46
|
+
* @default true
|
47
|
+
*/
|
48
|
+
injectLoader?: boolean;
|
44
49
|
};
|
45
50
|
export interface NormalizedPluginOptions extends Required<PluginOptions> {
|
46
51
|
overlay: false | OverlayOptions;
|
package/dist/options.js
CHANGED
@@ -32,6 +32,7 @@ function normalizeOptions(options) {
|
|
32
32
|
d(options, 'include', /\.([cm]js|[jt]sx?|flow)$/i);
|
33
33
|
d(options, 'library');
|
34
34
|
d(options, 'forceEnable', false);
|
35
|
+
d(options, 'injectLoader', true);
|
35
36
|
options.overlay = normalizeOverlay(options.overlay);
|
36
37
|
return options;
|
37
38
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@rspack/plugin-react-refresh",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.1.1",
|
4
4
|
"repository": "https://github.com/rspack-contrib/rspack-plugin-react-refresh",
|
5
5
|
"license": "MIT",
|
6
6
|
"description": "React refresh plugin for rspack",
|
@@ -29,27 +29,27 @@
|
|
29
29
|
},
|
30
30
|
"devDependencies": {
|
31
31
|
"@biomejs/biome": "^1.9.4",
|
32
|
-
"@rspack/core": "1.1
|
32
|
+
"@rspack/core": "1.3.1",
|
33
33
|
"@types/jest": "29.5.14",
|
34
|
-
"@types/node": "^22.
|
34
|
+
"@types/node": "^22.13.17",
|
35
35
|
"cross-env": "^7.0.3",
|
36
|
-
"execa": "9.5.
|
37
|
-
"fs-extra": "11.
|
36
|
+
"execa": "9.5.2",
|
37
|
+
"fs-extra": "11.3.0",
|
38
38
|
"jest": "29.7.0",
|
39
39
|
"jest-cli": "29.7.0",
|
40
40
|
"jest-environment-node": "29.7.0",
|
41
41
|
"nano-staged": "^0.8.0",
|
42
|
-
"react-refresh": "^0.
|
43
|
-
"semver": "7.
|
44
|
-
"simple-git-hooks": "^2.
|
45
|
-
"ts-jest": "29.
|
42
|
+
"react-refresh": "^0.17.0",
|
43
|
+
"semver": "7.7.1",
|
44
|
+
"simple-git-hooks": "^2.12.1",
|
45
|
+
"ts-jest": "29.3.1",
|
46
46
|
"ts-node": "^10.9.2",
|
47
|
-
"typescript": "5.
|
47
|
+
"typescript": "5.8.2",
|
48
48
|
"@continuous-auth/client": "2.3.2"
|
49
49
|
},
|
50
50
|
"dependencies": {
|
51
51
|
"error-stack-parser": "^2.1.4",
|
52
|
-
"html-entities": "^2.
|
52
|
+
"html-entities": "^2.6.0"
|
53
53
|
},
|
54
54
|
"peerDependencies": {
|
55
55
|
"react-refresh": ">=0.10.0 <1.0.0",
|