wmr
wmr copied to clipboard
Built HTML entries should contain CSS stylesheets even if not explicitly included
This might be a little difficult to explain with the title alone, but basically, if you have this kind of setup where you don't have a stylesheet in the HTML entries...
<!-- index.html -->
<!-- the HTML doesn't have any link tag to a stylesheet -->
<script type='module' src='./index.js'></script>
// index.js
import './style/normalize.css';
It wouldn't actually try to attach any stylesheets to that HTML, which I suppose somewhat makes sense? Though it does lead to confusion for people that are so used to only importing stylesheets via JS (say, modern-normalize
)
100% - I really want to add this. It's a tiny bit of a guessing game as to where in the HTML file WMR should inject the stylesheet, but "before the script that we hoisted it to" is probably a reasonable default.