mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-13 09:17:20 +00:00
Allow specifying a function/regex URL filter for external stylesheets
This commit is contained in:
@@ -26,6 +26,10 @@ const PARSE5_OPTS = {
|
||||
module.exports = class CrittersWebpackPlugin {
|
||||
constructor(options) {
|
||||
this.options = options || {};
|
||||
this.urlFilter = this.options.filter;
|
||||
if (this.urlFilter instanceof RegExp) {
|
||||
this.urlFilter = this.urlFilter.test.bind(this.urlFilter);
|
||||
}
|
||||
}
|
||||
|
||||
/** Invoked by Webpack during plugin initialization */
|
||||
|
||||
Reference in New Issue
Block a user