Skip to content

Commit 557e127

Browse files
authored
Merge pull request #103 from kevinzwhuang/master
Update README to reflect Webpack 2 change to require -loader suffix
2 parents 1ba23b2 + 25ebe3f commit 557e127

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,28 +53,28 @@ With this configuration:
5353
```
5454

5555
```js
56-
require("html!./file.html");
56+
require("html-loader!./file.html");
5757

5858
// => '<img src="http://cdn.example.com/49eba9f/a992ca.png"
5959
// data-src="image2x.png">'
6060
```
6161

6262
```js
63-
require("html?attrs=img:data-src!./file.html");
63+
require("html-loader?attrs=img:data-src!./file.html");
6464

6565
// => '<img src="image.png" data-src="data:image/png;base64,..." >'
6666
```
6767

6868
```js
69-
require("html?attrs=img:src img:data-src!./file.html");
70-
require("html?attrs[]=img:src&attrs[]=img:data-src!./file.html");
69+
require("html-loader?attrs=img:src img:data-src!./file.html");
70+
require("html-loader?attrs[]=img:src&attrs[]=img:data-src!./file.html");
7171

7272
// => '<img src="http://cdn.example.com/49eba9f/a992ca.png"
7373
// data-src="data:image/png;base64,..." >'
7474
```
7575

7676
```js
77-
require("html?-attrs!./file.html");
77+
require("html-loader?-attrs!./file.html");
7878

7979
// => '<img src="image.jpg" data-src="image2x.png" >'
8080
```
@@ -114,13 +114,13 @@ With the same configuration as above:
114114
```
115115

116116
```js
117-
require("html!./file.html");
117+
require("html-loader!./file.html");
118118

119119
// => '<img src="/image.jpg">'
120120
```
121121

122122
```js
123-
require("html?root=.!./file.html");
123+
require("html-loader?root=.!./file.html");
124124

125125
// => '<img src="http://cdn.example.com/49eba9f/a992ca.jpg">'
126126
```
@@ -130,7 +130,7 @@ require("html?root=.!./file.html");
130130
You can use `interpolate` flag to enable interpolation syntax for ES6 template strings, like so:
131131

132132
```js
133-
require("html?interpolate!./file.html");
133+
require("html-loader?interpolate!./file.html");
134134
```
135135

136136
```html
@@ -141,7 +141,7 @@ require("html?interpolate!./file.html");
141141
And if you only want to use `require` in template and any other `${}` are not to be translated, you can set `interpolate` flag to `require`, like so:
142142

143143
```js
144-
require("html?interpolate=require!./file.ftl");
144+
require("html-loader?interpolate=require!./file.ftl");
145145
```
146146

147147
```html
@@ -176,7 +176,7 @@ module.exports = {
176176
loaders: [
177177
{
178178
test: /\.html$/,
179-
loader: "html"
179+
loader: "html-loader"
180180
}
181181
]
182182
},
@@ -188,7 +188,7 @@ module.exports = {
188188
};
189189
```
190190

191-
If you need to define two different loader configs, you can also change the config's property name via `html?config=otherHtmlLoaderConfig`:
191+
If you need to define two different loader configs, you can also change the config's property name via `html-loader?config=otherHtmlLoaderConfig`:
192192

193193
```js
194194
module.exports = {
@@ -197,7 +197,7 @@ module.exports = {
197197
loaders: [
198198
{
199199
test: /\.html$/,
200-
loader: "html?config=otherHtmlLoaderConfig"
200+
loader: "html-loader?config=otherHtmlLoaderConfig"
201201
}
202202
]
203203
},

0 commit comments

Comments
 (0)