@@ -53,28 +53,28 @@ With this configuration:
53
53
```
54
54
55
55
``` js
56
- require (" html!./file.html" );
56
+ require (" html-loader !./file.html" );
57
57
58
58
// => '<img src="http://cdn.example.com/49eba9f/a992ca.png"
59
59
// data-src="image2x.png">'
60
60
```
61
61
62
62
``` js
63
- require (" html?attrs=img:data-src!./file.html" );
63
+ require (" html-loader ?attrs=img:data-src!./file.html" );
64
64
65
65
// => '<img src="image.png" data-src="data:image/png;base64,..." >'
66
66
```
67
67
68
68
``` 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" );
71
71
72
72
// => '<img src="http://cdn.example.com/49eba9f/a992ca.png"
73
73
// data-src="data:image/png;base64,..." >'
74
74
```
75
75
76
76
``` js
77
- require (" html?-attrs!./file.html" );
77
+ require (" html-loader ?-attrs!./file.html" );
78
78
79
79
// => '<img src="image.jpg" data-src="image2x.png" >'
80
80
```
@@ -114,13 +114,13 @@ With the same configuration as above:
114
114
```
115
115
116
116
``` js
117
- require (" html!./file.html" );
117
+ require (" html-loader !./file.html" );
118
118
119
119
// => '<img src="/image.jpg">'
120
120
```
121
121
122
122
``` js
123
- require (" html?root=.!./file.html" );
123
+ require (" html-loader ?root=.!./file.html" );
124
124
125
125
// => '<img src="http://cdn.example.com/49eba9f/a992ca.jpg">'
126
126
```
@@ -130,7 +130,7 @@ require("html?root=.!./file.html");
130
130
You can use ` interpolate ` flag to enable interpolation syntax for ES6 template strings, like so:
131
131
132
132
``` js
133
- require (" html?interpolate!./file.html" );
133
+ require (" html-loader ?interpolate!./file.html" );
134
134
```
135
135
136
136
``` html
@@ -141,7 +141,7 @@ require("html?interpolate!./file.html");
141
141
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:
142
142
143
143
``` js
144
- require (" html?interpolate=require!./file.ftl" );
144
+ require (" html-loader ?interpolate=require!./file.ftl" );
145
145
```
146
146
147
147
``` html
@@ -176,7 +176,7 @@ module.exports = {
176
176
loaders: [
177
177
{
178
178
test: / \. html$ / ,
179
- loader: " html"
179
+ loader: " html-loader "
180
180
}
181
181
]
182
182
},
@@ -188,7 +188,7 @@ module.exports = {
188
188
};
189
189
```
190
190
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 ` :
192
192
193
193
``` js
194
194
module .exports = {
@@ -197,7 +197,7 @@ module.exports = {
197
197
loaders: [
198
198
{
199
199
test: / \. html$ / ,
200
- loader: " html?config=otherHtmlLoaderConfig"
200
+ loader: " html-loader ?config=otherHtmlLoaderConfig"
201
201
}
202
202
]
203
203
},
0 commit comments