Skip to content

Commit 64f74aa

Browse files
Updated example for Nuxt.js 2.x
1 parent 53be386 commit 64f74aa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ module.exports = {
4242
};
4343
```
4444

45-
### Nuxt.js
45+
### Nuxt.js (1.x / 2.x)
4646
``` js
4747
module.exports = {
4848
build: {
4949
extend: (config) => {
50-
const svgRule = config.module.rules.find(rule => rule.loader === 'url-loader');
50+
const svgRule = config.module.rules.find(rule => rule.test.test('.svg'));
5151

52-
svgRule.test = /\.(png|jpe?g|gif)$/;
52+
svgRule.test = /\.(png|jpe?g|gif|webp)$/;
5353

5454
config.module.rules.push({
5555
test: /\.svg$/,

0 commit comments

Comments
 (0)