@modern-js/plugin-swc 2.58.0 → 2.58.2
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 -1
- package/dist/index.js +7 -7
- package/package.json +9 -9
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AppTools, CliPlugin } from '@modern-js/app-tools';
|
|
2
|
-
import { PluginSwcOptions } from '@rsbuild/plugin-swc';
|
|
2
|
+
import { type PluginSwcOptions } from '@rsbuild/plugin-swc';
|
|
3
3
|
import type { ToolsUserConfig } from '@modern-js/app-tools/src/types/config/tools';
|
|
4
4
|
export declare function factory(name: string, modifySwcOptions: (options: PluginSwcOptions) => PluginSwcOptions): () => CliPlugin<AppTools>;
|
|
5
5
|
export declare function applyBuilderSwcConfig(swc: PluginSwcOptions, esbuild: ToolsUserConfig['esbuild'] | undefined, isSSR: boolean): PluginSwcOptions;
|
package/dist/index.js
CHANGED
|
@@ -40,27 +40,27 @@ function factory(name, modifySwcOptions) {
|
|
|
40
40
|
const { esbuild, swc = {} } = config.tools;
|
|
41
41
|
const swcOptions = modifySwcOptions(swc);
|
|
42
42
|
const finalConfig = applyBuilderSwcConfig(swcOptions, esbuild, (0, import_utils.isSSR)(config));
|
|
43
|
-
var _config_performance_transformLodash;
|
|
44
43
|
context.builder.addPlugins([
|
|
45
|
-
(0, import_plugin_swc.pluginSwc)({
|
|
46
|
-
|
|
47
|
-
transformLodash
|
|
48
|
-
})
|
|
44
|
+
(0, import_plugin_swc.pluginSwc)(applyConfig(finalConfig, (swcConfig) => {
|
|
45
|
+
var _config_performance_transformLodash;
|
|
46
|
+
swcConfig.transformLodash = (_config_performance_transformLodash = config.performance.transformLodash) !== null && _config_performance_transformLodash !== void 0 ? _config_performance_transformLodash : true;
|
|
47
|
+
}))
|
|
49
48
|
]);
|
|
50
49
|
}
|
|
51
50
|
})
|
|
52
51
|
});
|
|
53
52
|
}
|
|
54
53
|
function applyBuilderSwcConfig(swc, esbuild, isSSR2) {
|
|
54
|
+
let swcConfig = swc;
|
|
55
55
|
if (isSSR2) {
|
|
56
|
-
|
|
56
|
+
swcConfig = applyConfig(swc, (config) => {
|
|
57
57
|
var _config;
|
|
58
58
|
var _extensions;
|
|
59
59
|
(_extensions = (_config = config).extensions) !== null && _extensions !== void 0 ? _extensions : _config.extensions = {};
|
|
60
60
|
config.extensions.loadableComponents = true;
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
|
-
return applyConfig(
|
|
63
|
+
return applyConfig(swcConfig, (config) => {
|
|
64
64
|
if (esbuild) {
|
|
65
65
|
if (config.jsMinify !== false && esbuild.minimize !== false) {
|
|
66
66
|
import_logger.logger.warn("You have enabled both esbuild minimizer and SWC minimizer, which will cause conflicts. Please remove `tools.esbuild` config and only use SWC to minimize your code.");
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"modern",
|
|
15
15
|
"modern.js"
|
|
16
16
|
],
|
|
17
|
-
"version": "2.58.
|
|
17
|
+
"version": "2.58.2",
|
|
18
18
|
"jsnext:source": "./src/index.ts",
|
|
19
19
|
"types": "./dist/index.d.ts",
|
|
20
20
|
"main": "./dist/index.js",
|
|
@@ -31,19 +31,19 @@
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@rsbuild/core": "1.0.1-beta.
|
|
35
|
-
"@rsbuild/plugin-swc": "1.0.1-beta.
|
|
34
|
+
"@rsbuild/core": "1.0.1-beta.14",
|
|
35
|
+
"@rsbuild/plugin-swc": "1.0.1-beta.14",
|
|
36
36
|
"@swc/helpers": "0.5.3",
|
|
37
|
-
"@modern-js/utils": "2.58.
|
|
37
|
+
"@modern-js/utils": "2.58.2"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@types/node": "^14",
|
|
41
40
|
"@types/jest": "^29",
|
|
41
|
+
"@types/node": "^14",
|
|
42
42
|
"typescript": "^5",
|
|
43
|
-
"@modern-js/app-tools": "2.58.
|
|
44
|
-
"@
|
|
45
|
-
"@
|
|
46
|
-
"@scripts/jest-config": "2.58.
|
|
43
|
+
"@modern-js/app-tools": "2.58.2",
|
|
44
|
+
"@scripts/build": "2.58.2",
|
|
45
|
+
"@modern-js/types": "2.58.2",
|
|
46
|
+
"@scripts/jest-config": "2.58.2"
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"registry": "https://registry.npmjs.org/",
|