@bleedingdev/modern-js-builder 3.5.0-ultramodern.26 → 3.5.0-ultramodern.28

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.
@@ -49,6 +49,17 @@ const external_tsgo_js_namespaceObject = require("./tsgo.js");
49
49
  const external_utils_js_namespaceObject = require("./utils.js");
50
50
  const CSS_MODULES_REGEX = /\.modules?\.\w+$/i;
51
51
  const GLOBAL_CSS_REGEX = /\.global\.\w+$/;
52
+ const DEFAULT_CSS_MINIFIER_OPTIONS = {
53
+ minimizerOptions: {
54
+ preset: [
55
+ 'default',
56
+ {
57
+ calc: false,
58
+ mergeLonghand: false
59
+ }
60
+ ]
61
+ }
62
+ };
52
63
  const isLooseCssModules = (path)=>{
53
64
  if (external_utils_js_namespaceObject.NODE_MODULES_REGEX.test(path)) return CSS_MODULES_REGEX.test(path);
54
65
  return !GLOBAL_CSS_REGEX.test(path);
@@ -208,7 +219,7 @@ async function parseCommonConfig(builderConfig, options) {
208
219
  };
209
220
  }
210
221
  rsbuildPlugins.push((0, plugin_css_minimizer_namespaceObject.pluginCssMinimizer)({
211
- pluginOptions: minifyCss
222
+ pluginOptions: minifyCss ?? DEFAULT_CSS_MINIFIER_OPTIONS
212
223
  }));
213
224
  if (enableAssetManifest) {
214
225
  const { pluginManifest } = await import("../plugins/manifest.js");
@@ -16,6 +16,17 @@ import { withTsgoDefaults } from "./tsgo.mjs";
16
16
  import { NODE_MODULES_REGEX } from "./utils.mjs";
17
17
  const CSS_MODULES_REGEX = /\.modules?\.\w+$/i;
18
18
  const GLOBAL_CSS_REGEX = /\.global\.\w+$/;
19
+ const DEFAULT_CSS_MINIFIER_OPTIONS = {
20
+ minimizerOptions: {
21
+ preset: [
22
+ 'default',
23
+ {
24
+ calc: false,
25
+ mergeLonghand: false
26
+ }
27
+ ]
28
+ }
29
+ };
19
30
  const isLooseCssModules = (path)=>{
20
31
  if (NODE_MODULES_REGEX.test(path)) return CSS_MODULES_REGEX.test(path);
21
32
  return !GLOBAL_CSS_REGEX.test(path);
@@ -175,7 +186,7 @@ async function parseCommonConfig(builderConfig, options) {
175
186
  };
176
187
  }
177
188
  rsbuildPlugins.push(pluginCssMinimizer({
178
- pluginOptions: minifyCss
189
+ pluginOptions: minifyCss ?? DEFAULT_CSS_MINIFIER_OPTIONS
179
190
  }));
180
191
  if (enableAssetManifest) {
181
192
  const { pluginManifest } = await import("../plugins/manifest.mjs");
@@ -17,6 +17,17 @@ import { withTsgoDefaults } from "./tsgo.mjs";
17
17
  import { NODE_MODULES_REGEX } from "./utils.mjs";
18
18
  const CSS_MODULES_REGEX = /\.modules?\.\w+$/i;
19
19
  const GLOBAL_CSS_REGEX = /\.global\.\w+$/;
20
+ const DEFAULT_CSS_MINIFIER_OPTIONS = {
21
+ minimizerOptions: {
22
+ preset: [
23
+ 'default',
24
+ {
25
+ calc: false,
26
+ mergeLonghand: false
27
+ }
28
+ ]
29
+ }
30
+ };
20
31
  const isLooseCssModules = (path)=>{
21
32
  if (NODE_MODULES_REGEX.test(path)) return CSS_MODULES_REGEX.test(path);
22
33
  return !GLOBAL_CSS_REGEX.test(path);
@@ -176,7 +187,7 @@ async function parseCommonConfig(builderConfig, options) {
176
187
  };
177
188
  }
178
189
  rsbuildPlugins.push(pluginCssMinimizer({
179
- pluginOptions: minifyCss
190
+ pluginOptions: minifyCss ?? DEFAULT_CSS_MINIFIER_OPTIONS
180
191
  }));
181
192
  if (enableAssetManifest) {
182
193
  const { pluginManifest } = await import("../plugins/manifest.mjs");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bleedingdev/modern-js-builder",
3
- "version": "3.5.0-ultramodern.26",
3
+ "version": "3.5.0-ultramodern.28",
4
4
  "description": "A builder for Modern.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -59,7 +59,7 @@
59
59
  "rsbuild-plugin-rsc": "0.1.1",
60
60
  "rspack-manifest-plugin": "5.2.2",
61
61
  "ts-deepmerge": "8.0.0",
62
- "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.5.0-ultramodern.26"
62
+ "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.5.0-ultramodern.28"
63
63
  },
64
64
  "devDependencies": {
65
65
  "@rslib/core": "0.23.1",
@@ -69,7 +69,7 @@
69
69
  "terser": "^5.48.0",
70
70
  "typescript": "^6.0.3",
71
71
  "@scripts/rstest-config": "2.66.0",
72
- "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.5.0-ultramodern.26"
72
+ "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.5.0-ultramodern.28"
73
73
  },
74
74
  "publishConfig": {
75
75
  "access": "public",