Skip to content

Commit 047f71f

Browse files
author
furina-lu
committed
feat: support switch filter model
1 parent 0925440 commit 047f71f

File tree

11 files changed

+4016
-16
lines changed

11 files changed

+4016
-16
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rollup-plugin-visualizer",
3-
"version": "5.14.0",
3+
"version": "5.15.0",
44
"main": "./dist/plugin/index.js",
55
"author": "Denis Bardadym <[email protected]>",
66
"license": "MIT",

plugin/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ export interface PluginVisualizerOptions {
113113
* default. Otherwise, an ID must match one or more of the picomatch patterns, and must not match any of the options.exclude patterns.
114114
*/
115115
exclude?: Filter | Filter[];
116+
117+
/**
118+
* filterModel: 'glob' | 'regexp'
119+
*/
120+
filterModel?: 'glob' | 'regexp'
116121
}
117122

118123
const defaultSizeGetter: SizeGetter = () => Promise.resolve(0);
@@ -152,7 +157,7 @@ export const visualizer = (
152157
const template = opts.template ?? "treemap";
153158
const projectRoot = opts.projectRoot ?? process.cwd();
154159

155-
const filter = createFilter(opts.include, opts.exclude);
160+
const filter = createFilter(opts.include, opts.exclude, opts.filterModel || 'glob');
156161

157162
const gzipSize = !!opts.gzipSize && !opts.sourcemap;
158163
const brotliSize = !!opts.brotliSize && !opts.sourcemap;

0 commit comments

Comments
 (0)