Skip to content

Commit 2ddca36

Browse files
committed
Merge pull request #5 from mankdev/master
Fix urls resolving for windows
2 parents ca59ea8 + ca03679 commit 2ddca36

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,12 @@ function getUrl(url) {
4545
return url.match(/(['"]?)(.+)\1/)[2];
4646
}
4747

48+
function normalizeUrl(url) {
49+
return (path.sep === '\\') ? url.replace(/\\/g, '\/') : url;
50+
}
51+
4852
function composeUrl(url) {
49-
return 'url(' + url + ')';
53+
return 'url(' + normalizeUrl(url) + ')';
5054
}
5155

5256
// checks if file is not local

0 commit comments

Comments
 (0)