@modern-js/plugin-swc 2.42.1 → 2.43.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.
Files changed (2) hide show
  1. package/dist/index.js +11 -11
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -50,10 +50,10 @@ function factory(name, modifySwcOptions) {
50
50
  function applyBuilderSwcConfig(swc, esbuild, isSSR2) {
51
51
  if (isSSR2) {
52
52
  swc = applyConfig(swc, (config) => {
53
- config.extensions = {
54
- ...config.extensions || {},
55
- loadableComponents: true
56
- };
53
+ var _config;
54
+ var _extensions;
55
+ (_extensions = (_config = config).extensions) !== null && _extensions !== void 0 ? _extensions : _config.extensions = {};
56
+ config.extensions.loadableComponents = true;
57
57
  });
58
58
  }
59
59
  return applyConfig(swc, (config) => {
@@ -70,12 +70,12 @@ function applyBuilderSwcConfig(swc, esbuild, isSSR2) {
70
70
  const PLUGIN_NAME = "@modern-js/plugin-swc";
71
71
  const swcPlugin = factory(PLUGIN_NAME, (swcOptions) => {
72
72
  return applyConfig(swcOptions, (swcOptions2) => {
73
- swcOptions2.extensions = {
74
- ...swcOptions2.extensions || {},
75
- ssrLoaderId: {
76
- runtimePackageName: "@modern-js/runtime",
77
- functionUseLoaderName: "useLoader"
78
- }
73
+ var _swcOptions;
74
+ var _extensions;
75
+ (_extensions = (_swcOptions = swcOptions2).extensions) !== null && _extensions !== void 0 ? _extensions : _swcOptions.extensions = {};
76
+ swcOptions2.extensions.ssrLoaderId = {
77
+ runtimePackageName: "@modern-js/runtime",
78
+ functionUseLoaderName: "useLoader"
79
79
  };
80
80
  });
81
81
  });
@@ -83,7 +83,7 @@ function applyConfig(rawConfig, handler) {
83
83
  if (typeof rawConfig === "function") {
84
84
  return (config, utils) => {
85
85
  handler(config);
86
- return rawConfig(config, utils);
86
+ return rawConfig(config, utils) || config;
87
87
  };
88
88
  } else {
89
89
  handler(rawConfig);
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "modern",
15
15
  "modern.js"
16
16
  ],
17
- "version": "2.42.1",
17
+ "version": "2.43.0",
18
18
  "jsnext:source": "./src/index.ts",
19
19
  "types": "./dist/index.d.ts",
20
20
  "main": "./dist/index.js",
@@ -31,18 +31,18 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@swc/helpers": "0.5.3",
34
- "@modern-js/builder-plugin-swc": "2.42.1",
35
- "@modern-js/utils": "2.42.1"
34
+ "@modern-js/builder-plugin-swc": "2.43.0",
35
+ "@modern-js/utils": "2.43.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/node": "^14",
39
39
  "@types/jest": "^29",
40
40
  "typescript": "^5",
41
- "@modern-js/app-tools": "2.42.1",
42
- "@scripts/build": "2.42.1",
43
- "@scripts/jest-config": "2.42.1",
44
- "@modern-js/builder-shared": "2.42.1",
45
- "@modern-js/types": "2.42.1"
41
+ "@modern-js/app-tools": "2.43.0",
42
+ "@modern-js/builder-shared": "2.43.0",
43
+ "@modern-js/types": "2.43.0",
44
+ "@scripts/build": "2.43.0",
45
+ "@scripts/jest-config": "2.43.0"
46
46
  },
47
47
  "publishConfig": {
48
48
  "registry": "https://registry.npmjs.org/",