Skip to content

Commit

Permalink
fix(gulp-purgecss): support skippedContentGlobs option #853
Browse files Browse the repository at this point in the history
  • Loading branch information
Ffloriel committed Feb 23, 2022
1 parent c822058 commit b72de77
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/gulp-purgecss/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ export { UserDefinedOptions };

const PLUGIN_NAME = "gulp-purgecss";

function getFiles(contentArray: string[]): string[] {
function getFiles(contentArray: string[], ignore?: string[]): string[] {
return contentArray.reduce((acc: string[], content) => {
return [...acc, ...glob.sync(content)];
return [...acc, ...glob.sync(content, { ignore })];
}, []);
}

Expand All @@ -33,7 +33,7 @@ function gulpPurgeCSS(options: UserDefinedOptions): internal.Transform {
try {
const optionsGulp = {
...options,
content: getFiles(options.content),
content: getFiles(options.content, options.skippedContentGlobs),
css: [
{
raw: file.contents.toString(),
Expand Down

0 comments on commit b72de77

Please sign in to comment.