Skip to content

Commit

Permalink
Merge pull request #81 from morrislaptop/css-globs
Browse files Browse the repository at this point in the history
Css globs
  • Loading branch information
Ffloriel authored Apr 23, 2018
2 parents afb5501 + d817923 commit 5b01959
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions __tests__/Methods/getFileExtracter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ describe('getFileExtractor', () => {
it('should throw an error for wrong extractor definition', () => {
expect(() => {
const purgecss = new Purgecss({
content: ['./test.html'],
css: ['./test.css'],
content: ['./__tests__/test_examples/attribute_selector/attribute_selector.html'],
css: ['./__tests__/test_examples/attribute_selector/attribute_selector.css'],
extractors: TEST_7
})
purgecss.purge()
Expand Down
6 changes: 6 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ class Purgecss {
getCssContents(cssOptions: Array<any>, cssSelectors: Set<string>): Array<ResultPurge> {
const sources = []

// resolve any globs and flatten again
cssOptions = cssOptions.map(option => {
return typeof option === 'string' ? glob.sync(option) : option
})
cssOptions = [].concat.apply([], cssOptions)

for (let option of cssOptions) {
let file = null
let cssContent = ''
Expand Down

0 comments on commit 5b01959

Please sign in to comment.