@gravity-ui/app-builder 0.16.3 → 0.16.4
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.
|
@@ -536,7 +536,7 @@ function createStylesRule(options) {
|
|
|
536
536
|
function getCssLoaders({ isEnvDevelopment, isEnvProduction, config, isSsr }, additionalRules) {
|
|
537
537
|
const isRspack = config.bundler === 'rspack';
|
|
538
538
|
const loaders = [];
|
|
539
|
-
if (!config.transformCssWithLightningCss
|
|
539
|
+
if (!config.transformCssWithLightningCss) {
|
|
540
540
|
loaders.push({
|
|
541
541
|
loader: require.resolve('postcss-loader'),
|
|
542
542
|
options: {
|
|
@@ -1079,6 +1079,28 @@ function configureRspackOptimization(helperOptions) {
|
|
|
1079
1079
|
if (isSsr) {
|
|
1080
1080
|
return {};
|
|
1081
1081
|
}
|
|
1082
|
+
let cssMinimizer;
|
|
1083
|
+
if (config.transformCssWithLightningCss) {
|
|
1084
|
+
cssMinimizer = new core_1.rspack.LightningCssMinimizerRspackPlugin({
|
|
1085
|
+
minimizerOptions: {
|
|
1086
|
+
// Plugin will read the browserslist itself and generate targets
|
|
1087
|
+
targets: [],
|
|
1088
|
+
},
|
|
1089
|
+
});
|
|
1090
|
+
}
|
|
1091
|
+
else {
|
|
1092
|
+
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|
|
1093
|
+
cssMinimizer = new CssMinimizerPlugin({
|
|
1094
|
+
minimizerOptions: {
|
|
1095
|
+
preset: [
|
|
1096
|
+
'default',
|
|
1097
|
+
{
|
|
1098
|
+
svgo: false,
|
|
1099
|
+
},
|
|
1100
|
+
],
|
|
1101
|
+
},
|
|
1102
|
+
});
|
|
1103
|
+
}
|
|
1082
1104
|
const optimization = {
|
|
1083
1105
|
splitChunks: getOptimizationSplitChunks(helperOptions),
|
|
1084
1106
|
runtimeChunk: 'single',
|
|
@@ -1094,12 +1116,7 @@ function configureRspackOptimization(helperOptions) {
|
|
|
1094
1116
|
},
|
|
1095
1117
|
},
|
|
1096
1118
|
}),
|
|
1097
|
-
|
|
1098
|
-
minimizerOptions: {
|
|
1099
|
-
// Plugin will read the browserslist itself and generate targets
|
|
1100
|
-
targets: [],
|
|
1101
|
-
},
|
|
1102
|
-
}),
|
|
1119
|
+
cssMinimizer,
|
|
1103
1120
|
],
|
|
1104
1121
|
};
|
|
1105
1122
|
return optimization;
|