Searching for a possible npm-based solution to replace:
<link rel='stylesheet' href='style.css'>
with
<style><!-- actual contents of the style.css file here --></style>
to simplify the process of building a lightweight static website. Many packages found that inline CSS into every DOM element, which is not the desired outcome.
The current build pipeline includes:
- Compiling SASS (minified)
- Minifying HTML
- Injecting minified CSS in HTML
<style>
tag.
Focused on finding a solution for step three.
Attempted using npm packages such as:
inlineCss
: incorrectly applies styles to each element.Styliner
: appeared to be broken.