failwyn / BundlerMinifier

Visual Studio extension
Other
41 stars 10 forks source link

Error in Css when using clamp #28

Open vikktor opened 9 months ago

vikktor commented 9 months ago

Installed product versions

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 ' '

failwyn commented 7 months ago

Can you check if this is supported by NUglify?

failwyn commented 6 months ago

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

vikktor commented 6 months ago

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 ' '

failwyn commented 3 months ago

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

vikktor commented 2 months ago

Sorry, I'm no longer using BundlerMinifier.