If you run getBundle output through a minifier before the transform gets to it, it will get removed!
Specifically this quick tip: https://www.11ty.dev/docs/quicktips/inline-css/#capture-and-minify
<!-- capture the CSS content as a Nunjucks variable -->
{% set css %}
{% include "sample.css" %}
{% getBundle "css" %}
{% endset %}
<!-- feed it through our cssmin filter to minify -->
<style>
{{ css | cssmin | safe }}
</style>
Workaround is to move the bundle outside of the css minification pipeline (and optionally use a bundle transform to minify instead):
<!-- capture the CSS content as a Nunjucks variable -->
{% set css %}
{% include "sample.css" %}
{% endset %}
<!-- feed it through our cssmin filter to minify -->
<style>
{{ css | cssmin | safe }}
</style>
<style>{% getBundle "css" %}</style>
If you run getBundle output through a minifier before the transform gets to it, it will get removed!
Specifically this quick tip: https://www.11ty.dev/docs/quicktips/inline-css/#capture-and-minify
Workaround is to move the bundle outside of the css minification pipeline (and optionally use a bundle transform to minify instead):