File tree 1 file changed +2
-63
lines changed
1 file changed +2
-63
lines changed Original file line number Diff line number Diff line change @@ -241,69 +241,6 @@ module.exports = {
241
241
242
242
If the tag name is not specified it will process all the tags.
243
243
244
- ** Note:** source with a ` tag ` option takes precedence over source without.
245
-
246
- For example, to process ` data-src ` attributes on _ all_ tags, omit the tag name:
247
-
248
- ** webpack.config.js**
249
-
250
- ``` js
251
- module .exports = {
252
- module: {
253
- rules: [
254
- {
255
- test: / \. html$ / i ,
256
- loader: " html-loader" ,
257
- options: {
258
- sources: {
259
- list: [
260
- {
261
- attribute: " data-src" ,
262
- type: " src" ,
263
- },
264
- ],
265
- },
266
- },
267
- },
268
- ],
269
- },
270
- };
271
- ```
272
-
273
- > ⚠ You ** must** specify a tag name if using ` ... ` to extend attributes for tags already in the default sources list
274
-
275
- For example, to extend the default source list so that it also processes ` data-src ` attributes on _ all_ tags, you might be tempted to do this:
276
-
277
- ``` js
278
- module .exports = {
279
- module: {
280
- rules: [
281
- {
282
- test: / \. html$ / i ,
283
- loader: " html-loader" ,
284
- options: {
285
- sources: {
286
- list: [
287
- // All default supported tags and attributes
288
- " ..." ,
289
- {
290
- attribute: " data-src" ,
291
- type: " src" ,
292
- },
293
- ],
294
- },
295
- },
296
- },
297
- ],
298
- },
299
- };
300
- ```
301
-
302
- However this will only process ` data-src ` attributes on tags that _ aren't in the default list_ :
303
-
304
- - ` <p data-src=".."> ` will be processed, as ` p ` is not in the default sources list
305
- - ` <img data-src=".."> ` won't be processed, as ` img ` is already in the default sources list
306
-
307
244
> You can use your custom filter to specify html elements to be processed.
308
245
309
246
For example:
@@ -383,6 +320,8 @@ module.exports = {
383
320
};
384
321
```
385
322
323
+ ** Note:** source with a ` tag ` option takes precedence over source without.
324
+
386
325
Filter can be used to disable default sources.
387
326
388
327
For example:
You can’t perform that action at this time.
0 commit comments