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

Excluding absolute url #21

Closed
mijikim opened this issue Sep 24, 2015 · 6 comments · Fixed by #35
Closed

Excluding absolute url #21

mijikim opened this issue Sep 24, 2015 · 6 comments · Fixed by #35

Comments

@mijikim
Copy link

mijikim commented Sep 24, 2015

Hello,
Is there a way for cdnizer to not modify absolute urls? When I run cdnizer on a file that has below url, it removes one of the forward slash.

input
< link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" />

output
< link rel="stylesheet" href="/code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" />

Thank you!

@OverZealous
Copy link
Owner

You just have to be more explicit in your file patterns. The default ones (such as those for the CDN values) are very loose, and will match pretty much anything.

It shouldn't be modifying any URL that is not matched.

@mijikim
Copy link
Author

mijikim commented Sep 28, 2015

Is there a way to achieve this by ignoring paths that matches certain patterns instead of relying on file patterns? If I have a file that has both absolute path like the one shown above and paths that I would like to be cdnized, then file patterns won't help me that much.

@OverZealous
Copy link
Owner

Right now there is no support for exclusions. I'm willing to look at a Pull Request, but I don't want to change the default behavior.

@thescientist13
Copy link
Contributor

A little late to the party but made an attempt at solving this.

@OverZealous
Copy link
Owner

Thanks @thescientist13! It's published with a new feature flag, excludeAbsolute, under version 3.1.0

I'll probably bump the version on gulp-cdnizer, too

@thescientist13
Copy link
Contributor

Just tried it out in my project and working great!

Thanks @OverZealous for the help and of course making cdnizer in the first place. 🏆

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

Successfully merging a pull request may close this issue.

3 participants