SassNinja / media-query-plugin

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

Missing support for Webpack 5.0 filename being a function #117

Open Nya-chan opened 1 year ago

Nya-chan commented 1 year ago

In WP5 you can now use functions for file output path (see https://webpack.js.org/configuration/output/#outputfilename , can also be used in MiniCssExtractPlugin and others) The plugin currently only supports filename being a string / with a template and fails on providing a correct function that returns a string with such filename:

/node_modules/media-query-plugin/src/plugin.js:83
                                        .replace('[name]', mediaKey)
                                         ^

TypeError: this.options.filename.replace is not a function
    at /frontend/node_modules/media-query-plugin/src/plugin.js:83:42