@gravity-ui/app-builder 0.20.0 → 0.21.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.
|
@@ -364,7 +364,7 @@ async function createJavaScriptLoader({ isEnvProduction, isEnvDevelopment, confi
|
|
|
364
364
|
if (config.javaScriptLoader === 'swc') {
|
|
365
365
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
366
366
|
const plugins = [];
|
|
367
|
-
if (!isSsr && isEnvProduction) {
|
|
367
|
+
if (config.bundler !== 'rspack' && !isSsr && isEnvProduction) {
|
|
368
368
|
plugins.push([
|
|
369
369
|
require.resolve('@swc/plugin-transform-imports'),
|
|
370
370
|
{
|
|
@@ -410,8 +410,25 @@ async function createJavaScriptLoader({ isEnvProduction, isEnvDevelopment, confi
|
|
|
410
410
|
},
|
|
411
411
|
sourceMaps: !config.disableSourceMapGeneration,
|
|
412
412
|
}, { configType, isSsr });
|
|
413
|
+
if (config.bundler === 'rspack') {
|
|
414
|
+
const rspackSwcConfig = swcConfig;
|
|
415
|
+
if (!isSsr && isEnvProduction) {
|
|
416
|
+
rspackSwcConfig.rspackExperiments = {
|
|
417
|
+
import: [
|
|
418
|
+
{
|
|
419
|
+
libraryName: 'lodash',
|
|
420
|
+
customName: 'lodash/{{member}}',
|
|
421
|
+
},
|
|
422
|
+
],
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
return {
|
|
426
|
+
loader: 'builtin:swc-loader',
|
|
427
|
+
options: rspackSwcConfig,
|
|
428
|
+
};
|
|
429
|
+
}
|
|
413
430
|
return {
|
|
414
|
-
loader:
|
|
431
|
+
loader: require.resolve('swc-loader'),
|
|
415
432
|
options: swcConfig,
|
|
416
433
|
};
|
|
417
434
|
}
|