@rspack/plugin-react-refresh 0.4.5-canary-e55d819-20240108110043 → 0.4.5-canary-058c885-20240108162457

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.js CHANGED
@@ -26,16 +26,6 @@ class ReactRefreshRspackPlugin {
26
26
  this.options = (0, options_1.normalizeOptions)(options);
27
27
  }
28
28
  apply(compiler) {
29
- if (
30
- // Webpack do not set process.env.NODE_ENV, so we need to check for mode.
31
- // Ref: https://github.com/webpack/webpack/issues/7074
32
- (compiler.options.mode !== "development" ||
33
- // We also check for production process.env.NODE_ENV,
34
- // in case it was set and mode is non-development (e.g. 'none')
35
- (process.env.NODE_ENV && process.env.NODE_ENV === "production")) &&
36
- !this.options.forceEnable) {
37
- return;
38
- }
39
29
  new compiler.webpack.EntryPlugin(compiler.context, reactRefreshEntryPath, {
40
30
  name: undefined
41
31
  }).apply(compiler);
@@ -43,9 +33,7 @@ class ReactRefreshRspackPlugin {
43
33
  $ReactRefreshRuntime$: reactRefreshPath
44
34
  }).apply(compiler);
45
35
  compiler.options.module.rules.unshift({
46
- // @ts-expect-error
47
36
  include: this.options.include,
48
- // @ts-expect-error
49
37
  exclude: {
50
38
  or: [this.options.exclude, [...runtimePaths]].filter(Boolean)
51
39
  },
package/dist/options.d.ts CHANGED
@@ -2,6 +2,5 @@ export type PluginOptions = {
2
2
  include?: string | RegExp | (string | RegExp)[] | null;
3
3
  exclude?: string | RegExp | (string | RegExp)[] | null;
4
4
  library?: string;
5
- forceEnable?: boolean;
6
5
  };
7
6
  export declare function normalizeOptions(options: PluginOptions): PluginOptions;
package/dist/options.js CHANGED
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.normalizeOptions = void 0;
4
4
  const d = (object, property, defaultValue) => {
5
+ // TODO: should we also add default for null?
5
6
  if (typeof object[property] === "undefined" &&
6
7
  typeof defaultValue !== "undefined") {
7
8
  object[property] = defaultValue;
@@ -12,7 +13,6 @@ function normalizeOptions(options) {
12
13
  d(options, "exclude", /node_modules/i);
13
14
  d(options, "include", /\.([cm]js|[jt]sx?|flow)$/i);
14
15
  d(options, "library");
15
- d(options, "forceEnable", false);
16
16
  return options;
17
17
  }
18
18
  exports.normalizeOptions = normalizeOptions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/plugin-react-refresh",
3
- "version": "0.4.5-canary-e55d819-20240108110043",
3
+ "version": "0.4.5-canary-058c885-20240108162457",
4
4
  "license": "MIT",
5
5
  "description": "React refresh plugin for rspack",
6
6
  "main": "dist/index.js",
@@ -29,8 +29,8 @@
29
29
  },
30
30
  "devDependencies": {
31
31
  "react-refresh": "0.14.0",
32
- "@rspack/core": "0.4.5-canary-e55d819-20240108110043",
33
- "@rspack/plugin-react-refresh": "0.4.5-canary-e55d819-20240108110043"
32
+ "@rspack/core": "0.4.5-canary-058c885-20240108162457",
33
+ "@rspack/plugin-react-refresh": "0.4.5-canary-058c885-20240108162457"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "react-refresh": ">=0.10.0 <1.0.0"