Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable option merging for whitelistPatternsChildren and whitelistPatterns #29

Closed
DonNicoJs opened this issue Jan 21, 2019 · 3 comments
Closed

Comments

@DonNicoJs
Copy link

Currently whitelistPatternsChildren and whitelistPatterns https://www.purgecss.com/whitelisting#patterns
are not initialised ( as empty array) in the internal plugin config and so skipped by this function:

const mergedConfig = Object.entries(purgeCSS).reduce((options, [key, value]) => {
    const defaultValue = defaults[key]

    if (value && typeof value !== 'function' && Array.isArray(defaultValue)) {
      // Merge value with default value if array
      value = defaultValue.concat(value)
    } else if (typeof value === 'function') {
      // Executed value functions and provide default value as param
      value = value(defaultValue)
    }

    // Finally assign
    options[key] = value
    return options
  }, {})

PR to come

@DonNicoJs
Copy link
Author

@manniL shall I close this ?

@manniL
Copy link
Member

manniL commented Jan 21, 2019

@lordfuoco Yes, feel free to do so ☺️

PS: You can use Resolve #ISSUE in the PR to auto-close issues after merging ☺️

@DonNicoJs
Copy link
Author

@manniL opsie, true, forgot about that! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants