Open benmccann opened 3 years ago
I've got a version of this working here: https://github.com/sveltejs/sapper/blob/a05ba1b7dd13b0216165bc5e9767bf6e6870e153/src/core/create_compilers/RollupCompiler.ts#L129
Feel free to steal it!
+1 to add this feature
Webpack's style-loader has several different
injectType
s. It would be nice if some of these options were supported here as well. My motivation for asking is that I'm wondering if the number ofstyle
tags created by the plugin today would result in optimal performance. It seems like we could recalculate the CSSOM fewer times by injecting only a singlestyle
tag per chunk. And injecting the styles via alink
tag might result in reduced data transfer for hydrated apps, which would be quite niceI think that the
extract
option in this plugin creates only a single CSS file? It would be nice if there were a way to create one css chunk per js chunk in order to support this feature. Then I might be able to provide a function toinject
in order to write thelink
tag myself.