Skip to content

Commit 25ebe3f

Browse files
committed
Update README to reflect Webpack 2 change to require -loader suffix
1 parent f12aab1 commit 25ebe3f

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
```
@@ -100,13 +100,13 @@ With the same configuration as above:
100100
```
101101

102102
```js
103-
require("html!./file.html");
103+
require("html-loader!./file.html");
104104

105105
// => '<img src="/image.jpg">'
106106
```
107107

108108
```js
109-
require("html?root=.!./file.html");
109+
require("html-loader?root=.!./file.html");
110110

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

118118
```js
119-
require("html?interpolate!./file.html");
119+
require("html-loader?interpolate!./file.html");
120120
```
121121

122122
```html
@@ -127,7 +127,7 @@ require("html?interpolate!./file.html");
127127
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:
128128

129129
```js
130-
require("html?interpolate=require!./file.ftl");
130+
require("html-loader?interpolate=require!./file.ftl");
131131
```
132132

133133
```html
@@ -158,7 +158,7 @@ module.exports = {
158158
loaders: [
159159
{
160160
test: /\.html$/,
161-
loader: "html"
161+
loader: "html-loader"
162162
}
163163
]
164164
}
@@ -170,7 +170,7 @@ module.exports = {
170170
};
171171
```
172172

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

175175
```js
176176
module.exports = {
@@ -179,7 +179,7 @@ module.exports = {
179179
loaders: [
180180
{
181181
test: /\.html$/,
182-
loader: "html?config=otherHtmlLoaderConfig"
182+
loader: "html-loader?config=otherHtmlLoaderConfig"
183183
}
184184
]
185185
}

0 commit comments

Comments
 (0)