@gravity-ui/app-builder 0.20.0 → 0.21.1
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
|
}
|
|
@@ -1089,12 +1106,7 @@ function configureRspackOptimization(helperOptions) {
|
|
|
1089
1106
|
}
|
|
1090
1107
|
let cssMinimizer;
|
|
1091
1108
|
if (config.transformCssWithLightningCss) {
|
|
1092
|
-
cssMinimizer = new core_1.rspack.LightningCssMinimizerRspackPlugin(
|
|
1093
|
-
minimizerOptions: {
|
|
1094
|
-
// Plugin will read the browserslist itself and generate targets
|
|
1095
|
-
targets: [],
|
|
1096
|
-
},
|
|
1097
|
-
});
|
|
1109
|
+
cssMinimizer = new core_1.rspack.LightningCssMinimizerRspackPlugin();
|
|
1098
1110
|
}
|
|
1099
1111
|
else {
|
|
1100
1112
|
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|