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

Paths are wrongly converted #2

Closed
XhmikosR opened this issue Jan 24, 2014 · 6 comments
Closed

Paths are wrongly converted #2

XhmikosR opened this issue Jan 24, 2014 · 6 comments

Comments

@XhmikosR
Copy link
Contributor

Hi. When using grunt-concat-css on Windows I end up with wrong slashes for URLs.

.sprite {
    background-image: url("../img/sprite.png");
    background-repeat: no-repeat;
}
.sprite {
    background-image: url('source\assets\img\sprite.png');
    background-repeat: no-repeat;
}

The same goes for font-face src etc.

My Gruntfile's relevant part:

        concat_css: {
            dist: {
                src: ["<%= dirs.src %>/assets/css/bootstrap.css",
                      "<%= dirs.src %>/assets/css/font-awesome.css",
                      "<%= dirs.src %>/assets/css/jquery.fancybox.css",
                      "<%= dirs.src %>/assets/css/jquery.fancybox-thumbs.css",
                      "<%= dirs.src %>/assets/css/style.css"],
                dest: "<%= dirs.dest %>/assets/css/pack.css"
            }
        },
@XhmikosR
Copy link
Contributor Author

After digging into the plugin's source the issue is caused by rebaseUrls. Why is this option on by default?

@oliamb
Copy link
Contributor

oliamb commented Jan 24, 2014

At first it was even mandatory :)

I'll happily merge a pull request which did not rebase URL by default and that does not mess up on Windows platform.

@XhmikosR
Copy link
Contributor Author

I'm not sure I can take care of the latter, but for the first it's just a one line patch.

I'll try to make a PR later if someone else doesn't beat me to it.

Also, README.md needs update to reflect the options. The reason I didn't notice this earlier is because README has no reference at all...

@oliamb
Copy link
Contributor

oliamb commented Jan 24, 2014

That's true, Thanks for the report. I'll be grateful with a partial patch. I'll do the remaining part in the upcoming days.

@oliamb
Copy link
Contributor

oliamb commented Jan 24, 2014

From version 0.3.0, The path conversion is fixed and the rebaseUrls flag has been replaced by an assetBaseUrl option. If an assetBaseUrl is specified, appends this path to every relative assets declared in the css. This option is disabled by default.

Updated the README to reflect those options. Added unit test to ensure both default options and assetBaseUrl parameter works as expected.

Thanks again for the report.

@oliamb oliamb closed this as completed Jan 24, 2014
@XhmikosR
Copy link
Contributor Author

Awesome, thanks for the quick updates!

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