BundlerMinifier icon indicating copy to clipboard operation
BundlerMinifier copied to clipboard

Error in Css when using clamp

Open vikktor opened this issue 2 years ago • 5 comments

Installed product versions

  • Visual Studio: 2022 Community
  • This extension: 2.9.9

Description

Bundling fails if clamp CSS function is used anywhere in css code.

Steps to recreate

  1. Insert (for example) this line in your css: font-size: clamp(1.625rem, 1.3036rem + 1.4286vw, 3rem);
  2. Try to bundle it using this extension

Current behavior

Bundling fails with error: Error (Bundler & Minifier) Unexpected token, found ' '

vikktor avatar Jan 17 '24 12:01 vikktor

Can you check if this is supported by NUglify?

failwyn avatar Feb 28 '24 18:02 failwyn

The css you provided compiles fine for me, can you provide the entire file that is causing the error?

failwyn avatar Apr 03 '24 22:04 failwyn

Sure thing.

Just did experiment with only this line in css file:

color.css body { font-size: clamp(1.625rem, 1.3036rem + 1.4286vw, 3rem); }

bundleconfig.json { "outputFileName": "wwwroot/css/color.min.css", "inputFiles": [ "wwwroot/css/color.css" ], "minify": { "enabled": true, "commentMode": "none" } }

Result in Visual studio 2022 (Version 17.9.0) task runner:

wwwroot/css/color.min.css Unexpected token, found ' ' Unexpected token, found ' ' Expected function, found ' ' Expected semicolon or closing curly-brace, found ' '

vikktor avatar Apr 05 '24 07:04 vikktor

This error is caused by using math inside the clamp function; Can you add a bug to the NUglify repository and link it here?

failwyn avatar Jul 18 '24 16:07 failwyn

Sorry, I'm no longer using BundlerMinifier.

vikktor avatar Jul 31 '24 09:07 vikktor