Skip to content

Commit ba0790a

Browse files
lettertwosokra
authored andcommitted
Update README with info about root query param
1 parent 32a32d7 commit ba0790a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

+21
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,27 @@ module.exports = {
3939
};
4040
```
4141

42+
### 'Root-relative' urls
43+
44+
For urls that start with a `/`, the default behavior is to not translate them:
45+
* `url(/image.png)` => `url(/image.png)`
46+
47+
If a `root` query parameter is set, however, it will be prepended to the url
48+
and then translated:
49+
50+
With a config like:
51+
52+
``` javascript
53+
loaders: [
54+
{ test: /\.css/, loader: "style-loader!css-loader?root=." },
55+
...
56+
]
57+
```
58+
59+
The result is:
60+
61+
* `url(/image.png)` => `require("./image.png")`
62+
4263
## License
4364

4465
MIT (http://www.opensource.org/licenses/mit-license.php)

0 commit comments

Comments
 (0)