When I then build my project with vite build, this plugin inlines the contents of pico.min.css verbatim into a <style> tag in the built html file, as follows:
<style>
@charset "UTF-8";/*!
* Pico CSS v1.5.11 (https://picocss.com)
* Copyright 2019-2023 - Licensed under MIT
The @charset "UTF-8"; bit is not valid in a HTML file. This happens with both the cssMinify: false and cssMinify: "esbuild"build options.
As a workaround, I now spectify cssMinify: "lightningcss", which removes the mentioned @charset rule.
In my source html file I'm referencing Pico.css, as follows:
When I then build my project with
vite build
, this plugin inlines the contents ofpico.min.css
verbatim into a<style>
tag in the built html file, as follows:The
@charset "UTF-8";
bit is not valid in a HTML file. This happens with both thecssMinify: false
andcssMinify: "esbuild"
build
options.As a workaround, I now spectify
cssMinify: "lightningcss"
, which removes the mentioned@charset
rule.