Skip to content

Commit 688fe54

Browse files
committed
fixed #2: Detect @font-face urls()
1 parent 29576ff commit 688fe54

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

index.js

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ function annotateUrls(tree) {
101101
case "stylesheet": return iterateChildren();
102102
case "ruleset": return iterateChildren();
103103
case "block": return iterateChildren();
104+
case "atruleb": return iterateChildren();
104105
case "declaration": return iterateChildren();
105106
case "value": return iterateChildren();
106107
case "uri":

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "css-loader",
3-
"version": "0.6.0",
3+
"version": "0.6.1",
44
"author": "Tobias Koppers @sokra",
55
"description": "css loader module for webpack",
66
"dependencies": {

test/urlTest.js

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ describe("url", function() {
5050
["\".class { background: green url( \"+require(\"./img.png\")+\" ) xyz }\""]);
5151
test("background img 2", ".class { background: green url(~img/png ) url(aaa) xyz }",
5252
["\".class { background: green url(\"+require(\"img/png\")+\" ) url(\"+require(\"./aaa\")+\") xyz }\""]);
53+
test("font face", "@font-face { src: url(regular.woff) format('woff'), url(~truetype/regular.ttf) format('truetype') }",
54+
["\"@font-face { src: url(\"+require(\"./regular.woff\")+\") format('woff'), url(\"+require(\"truetype/regular.ttf\")+\") format('truetype') }\""]);
5355
testMinimize("minimized simple", ".class { a: b c d; }",
5456
["\".class{a:b c d}\""]);
5557
});

0 commit comments

Comments
 (0)