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

Allow to filter optimized fonts with an allowlist and a skiplist #48

Merged

Conversation

Moustachos
Copy link
Contributor

Add two options: allowedFilesRegex & skippedFilesRegex.

Both can be null or RegExp, they're mutually exclusive and allowedFilesRegex has priority over skippedFilesRegex.

Usage example (to only target FontAwesome):

const FontminPlugin = require('fontmin-webpack')

Encore
  .addPlugin(new FontminPlugin({
    allowedFilesRegex: /^fa-/
  }))

Fix #29
Fix #5

Add two options: allowedFilesRegex & skippedFilesRegex. Both can be null or RegExp, they're mutually exclusive and allowedFilesRegex has priority over skippedFilesRegex.

Fix patrickhulce#29
Fix patrickhulce#5
Copy link
Owner

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @Moustachos, looks great ! could you add a quick test for this?

@Moustachos
Copy link
Contributor Author

There you go :)

@patrickhulce
Copy link
Owner

thanks @Moustachos !

@patrickhulce
Copy link
Owner

heads up @Moustachos we have a lint failure, but LGTM other than that

@Moustachos
Copy link
Contributor Author

@patrickhulce it should be fixed now

@Moustachos
Copy link
Contributor Author

@patrickhulce could you merge this one when you got some time?

I also made a pull request on Fontmin lib to address a bug where invalid code points are pushed to output, due to of how code points uniqueness is checked (ecomfe/fontmin#92).

It's been merged in 0.9.9 so if you could upgrade it while you're at it, it would be sweet 👍

@patrickhulce patrickhulce changed the title Allow to filter optimized fonts with a whitelist and a blacklist Allow to filter optimized fonts with an allowlist and a skiplist Sep 14, 2021
@patrickhulce patrickhulce merged commit 4c72d42 into patrickhulce:master Sep 14, 2021
@patrickhulce
Copy link
Owner

thanks for the ping @Moustachos!

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

Successfully merging this pull request may close these issues.

Targeting Specific Font Files Support font whitelist/blacklist in options
2 participants