Closed wzrdtales closed 5 years ago
Ok I found out that, if there is no matches to the queries, extraced is empty. And it is empty since these are only direct matches and css nano alters the actual query.
Hi @wzrdtales
it's hard to say regarding your large webpack config with many plugins. My usual workflow is to comment out most parts and then bring it back one after the other to find the responsible one.
Ok I found out that, if there is no matches to the queries, extraced is empty.
Yup, only what matches the queries gets extracted from the original CSS. You think cssnano is responsible? If so a minimum config is appreciated.
I have it running by now. cssnano
is "responsible" or better said it is due to the fact, that the queries are checked as a hard string and not in the matter of equality of parsed result.
Using a string like this instead:
'only screen and (max-width:767px)': 'mobile'
Where only the one space is the thing being minified is the solution to the trouble.
Makes sense, if cssnano
removes that space the query doesn't match anymore of course.
Glad to hear you've been able to solve the problem :)
Hey there,
I am figuring out how to use your plugin. But I cannot get it working. It is not extracting anything at all. I finally decided to try to inject the css links manually in the template with a forEach on htmlWebpackPlugin.files.extracted.css. And the surprise, htmlWebpackPlugin.files.extracted.css is not defined at all. I am not exactly sure what is going wrong, so now I finally reach out here for help :)
So first of all my environment:
package.json
from the config
So actually this plugin doesn't seem to do anything at all currently. Maybe it is incompatible?
Aditionally I have a doubt, that this plugin can actually work with a plugin I intend to use: https://github.com/GoogleChromeLabs/critters any thoughts to that?