SassNinja / postcss-extract-media-query

PostCSS plugin to extract all media query from CSS and emit as separate files.
MIT License
130 stars 20 forks source link

Webpack & entrypoints.json #40

Closed xkzl closed 1 year ago

xkzl commented 1 year ago

Hello,

I am using Webpack 5.0 and Webpack Encore from Symfony framework.

I noticed the generation of outgoing media stylesheets is done before Webpack setup its output directory. So these media files get deleted, if put inside the same directory as Webpack output.

Additionally, there is no entrypoints.json. Would it be easy to do ? For instance, I basically define an "app" entry and I get "app-mobile.css". So at the moment the loading of this file is hardcoded, but I need to make it more dynamic.

Thank you for the hard work. This plugin is great for optimization !

xkzl commented 1 year ago

Additionally, I just noticed that the outgoing css files does not relate to the entry defined in Webpack, but the basename of the extracted stylesheet.

e.g. ["app" => "path/to/my/app.test.css"] Webpack is returning app.css, but here the plugin is returning app.test-mobile.css instead of app-mobile.css. (At least I would expect that from Webpack point of view.)

xkzl commented 1 year ago

I just found that media-query-plugin is better fitted for Webpack. Thanks !