@gravity-ui/app-builder 0.16.2 → 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 && config.bundler !== 'rspack') {
539
+ if (!config.transformCssWithLightningCss) {
540
540
  loaders.push({
541
541
  loader: require.resolve('postcss-loader'),
542
542
  options: {
@@ -1063,7 +1063,12 @@ function configureOptimization(helperOptions) {
1063
1063
  if (typeof terser === 'function') {
1064
1064
  terserOptions = terser(terserOptions);
1065
1065
  }
1066
- new TerserPlugin({ terserOptions }).apply(compiler);
1066
+ new TerserPlugin({
1067
+ minify: config.javaScriptLoader === 'swc'
1068
+ ? TerserPlugin.swcMinify
1069
+ : TerserPlugin.terserMinify,
1070
+ terserOptions,
1071
+ }).apply(compiler);
1067
1072
  },
1068
1073
  ],
1069
1074
  };
@@ -1074,6 +1079,28 @@ function configureRspackOptimization(helperOptions) {
1074
1079
  if (isSsr) {
1075
1080
  return {};
1076
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
+ }
1077
1104
  const optimization = {
1078
1105
  splitChunks: getOptimizationSplitChunks(helperOptions),
1079
1106
  runtimeChunk: 'single',
@@ -1089,12 +1116,7 @@ function configureRspackOptimization(helperOptions) {
1089
1116
  },
1090
1117
  },
1091
1118
  }),
1092
- new core_1.rspack.LightningCssMinimizerRspackPlugin({
1093
- minimizerOptions: {
1094
- // Plugin will read the browserslist itself and generate targets
1095
- targets: [],
1096
- },
1097
- }),
1119
+ cssMinimizer,
1098
1120
  ],
1099
1121
  };
1100
1122
  return optimization;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/app-builder",
3
- "version": "0.16.2",
3
+ "version": "0.16.4",
4
4
  "description": "Develop and build your React client-server projects, powered by typescript and webpack",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",