@rsbuild/plugin-preact 0.3.11 → 0.4.0

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
@@ -44,14 +44,15 @@ var pluginPreact = (options = {}) => ({
44
44
  };
45
45
  (0, import_shared.modifySwcLoaderOptions)({
46
46
  chain,
47
- modifier: (options2) => {
48
- return (0, import_shared.deepmerge)(options2, {
49
- jsc: {
50
- transform: {
51
- react: reactOptions
52
- }
53
- }
54
- });
47
+ modifier: (opts) => {
48
+ var _a;
49
+ opts.jsc ?? (opts.jsc = {});
50
+ (_a = opts.jsc).transform ?? (_a.transform = {});
51
+ opts.jsc.transform.react = {
52
+ ...opts.jsc.transform.react,
53
+ ...reactOptions
54
+ };
55
+ return opts;
55
56
  }
56
57
  });
57
58
  });
package/dist/index.mjs CHANGED
@@ -7,10 +7,7 @@ import { fileURLToPath } from "url";
7
7
  import path from "path";
8
8
 
9
9
  // src/index.ts
10
- import {
11
- deepmerge,
12
- modifySwcLoaderOptions
13
- } from "@rsbuild/shared";
10
+ import { modifySwcLoaderOptions } from "@rsbuild/shared";
14
11
  var pluginPreact = (options = {}) => ({
15
12
  name: "rsbuild:preact",
16
13
  setup(api) {
@@ -31,14 +28,15 @@ var pluginPreact = (options = {}) => ({
31
28
  };
32
29
  modifySwcLoaderOptions({
33
30
  chain,
34
- modifier: (options2) => {
35
- return deepmerge(options2, {
36
- jsc: {
37
- transform: {
38
- react: reactOptions
39
- }
40
- }
41
- });
31
+ modifier: (opts) => {
32
+ var _a;
33
+ opts.jsc ?? (opts.jsc = {});
34
+ (_a = opts.jsc).transform ?? (_a.transform = {});
35
+ opts.jsc.transform.react = {
36
+ ...opts.jsc.transform.react,
37
+ ...reactOptions
38
+ };
39
+ return opts;
42
40
  }
43
41
  });
44
42
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/plugin-preact",
3
- "version": "0.3.11",
3
+ "version": "0.4.0",
4
4
  "description": "Preact plugin for Rsbuild",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,16 +22,16 @@
22
22
  "dist"
23
23
  ],
24
24
  "dependencies": {
25
- "@rsbuild/shared": "0.3.11"
25
+ "@rsbuild/shared": "0.4.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/node": "16.x",
29
29
  "typescript": "^5.3.0",
30
- "@rsbuild/core": "0.3.11",
31
- "@scripts/test-helper": "0.3.11"
30
+ "@rsbuild/core": "0.4.0",
31
+ "@scripts/test-helper": "0.4.0"
32
32
  },
33
33
  "peerDependencies": {
34
- "@rsbuild/core": "^0.3.11"
34
+ "@rsbuild/core": "^0.4.0"
35
35
  },
36
36
  "publishConfig": {
37
37
  "access": "public",