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

Add option to blacklist paths #254

Closed
IonicaBizau opened this issue Dec 9, 2016 · 5 comments
Closed

Add option to blacklist paths #254

IonicaBizau opened this issue Dec 9, 2016 · 5 comments

Comments

@IonicaBizau
Copy link

Let's say I want to blacklist a specific url, which is added in the result, inlined, currently.

How can I do that?

@RyanZim
Copy link
Collaborator

RyanZim commented Dec 9, 2016

@IonicaBizau I'm don't think that is possible currently. Wouldn't be opposed to adding that, would just need to add some conditional logic around https://github.com/postcss/postcss-import/blob/master/index.js#L182.

Won't have time to work on this in the near future, PR welcome.

We should probably accept a string or regex; or an array of strings or regexes to match against.

@RyanZim RyanZim changed the title How to blacklist paths? Add option to blacklist paths Dec 9, 2016
@IonicaBizau
Copy link
Author

@RyanZim I did try to hack into the code and specifically I already tried to change that line, but it just didn't work... It was still replacing the @imports with the content.

I'd be happy to add it, but will need some guidance where that should be added... 😁

Thanks!

@RyanZim
Copy link
Collaborator

RyanZim commented Dec 13, 2016

Adding another if statement with an empty return if the path is blacklisted should do it, not sure what your issue was. Right now I'm working 10 & 12-hour days at my day job, so no time to look at this now.

@IonicaBizau
Copy link
Author

It turns out that this tool is smart enough to know when it should inline the things and when not. Therefore a blacklist is not critical for me now.

Still, it'll be nice to have in the future.

RyanZim pushed a commit that referenced this issue Feb 10, 2018
This allows for conditionally processing imports based on their URLs.

Closes #279, #254, #299, #259
@RyanZim
Copy link
Collaborator

RyanZim commented Feb 10, 2018

Fixed in #327

@RyanZim RyanZim closed this as completed Feb 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants