@@ -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
```
@@ -100,13 +100,13 @@ With the same configuration as above:
100
100
```
101
101
102
102
``` js
103
- require (" html!./file.html" );
103
+ require (" html-loader !./file.html" );
104
104
105
105
// => '<img src="/image.jpg">'
106
106
```
107
107
108
108
``` js
109
- require (" html?root=.!./file.html" );
109
+ require (" html-loader ?root=.!./file.html" );
110
110
111
111
// => '<img src="http://cdn.example.com/49eba9f/a992ca.jpg">'
112
112
```
@@ -116,7 +116,7 @@ require("html?root=.!./file.html");
116
116
You can use ` interpolate ` flag to enable interpolation syntax for ES6 template strings, like so:
117
117
118
118
``` js
119
- require (" html?interpolate!./file.html" );
119
+ require (" html-loader ?interpolate!./file.html" );
120
120
```
121
121
122
122
``` html
@@ -127,7 +127,7 @@ require("html?interpolate!./file.html");
127
127
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:
128
128
129
129
``` js
130
- require (" html?interpolate=require!./file.ftl" );
130
+ require (" html-loader ?interpolate=require!./file.ftl" );
131
131
```
132
132
133
133
``` html
@@ -158,7 +158,7 @@ module.exports = {
158
158
loaders: [
159
159
{
160
160
test: / \. html$ / ,
161
- loader: " html"
161
+ loader: " html-loader "
162
162
}
163
163
]
164
164
}
@@ -170,7 +170,7 @@ module.exports = {
170
170
};
171
171
```
172
172
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 ` :
174
174
175
175
``` js
176
176
module .exports = {
@@ -179,7 +179,7 @@ module.exports = {
179
179
loaders: [
180
180
{
181
181
test: / \. html$ / ,
182
- loader: " html?config=otherHtmlLoaderConfig"
182
+ loader: " html-loader ?config=otherHtmlLoaderConfig"
183
183
}
184
184
]
185
185
}
0 commit comments