SassNinja / media-query-plugin

Webpack plugin for media query extraction.
MIT License
205 stars 27 forks source link

Enhence the compatilbily of filename as Function, also using Entrypoint names as includes and groups #83

Open yannicklin opened 3 years ago

yannicklin commented 3 years ago
  1. With the codes inspired from https://github.com/Vyprichenko/media-query-plugin, the (output) filename can accept be set as function type (with is useful in using css-minimizer-webpack-plugin.
  2. Since Webpack accepts multi-entries, it's a strong need to use the entry name rather than the file names of input. However, there is no formal Loader API to get the entry name by native, so I use the loop to identify the entry name it should be. So if there are multiple entries set in the webpack.config, then the plugin conditions (includes and groups) would check the responding entry names as possible. The fallback would be checking the original filename of input.