0

I need help with html-minimizer-webpack-plugin. Right now, when I write this:

<style>
.video__embed {
aspect-ratio: {video_width}/{video_height} !important; 
padding-top: 0 !important;
}
</style>

minifier removes {video_width}/{video_height}!important; padding-top: 0 !important;, resulting in

<style>.video__embed{aspect-ratio:{};}</style>

How can I configure the plugin to keep those values intact, but still minified?

2
  • The html-minimizer-web pack-plugin does not support variables. Can you try with this plugin postcss-preset-env (npmjs.com/package/postcss-preset-env). Commented Feb 26, 2023 at 14:17
  • How is it you're minifying CMS content? As yang zhou states below, only valid (compiled) CSS should be minified. Commented Mar 2, 2023 at 16:20

1 Answer 1

1
aspect-ratio: {video_width}/{video_height} !important;

This is not a valid CSS syntax. I think you should transpile this to valid CSS before use minimizer.

Sign up to request clarification or add additional context in comments.

1 Comment

This is, unfortunately, not possible in my scenario.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.