From 9e2451dc62a13811ea26b1354f2bf316bf62e60d Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Sun, 12 Dec 2021 19:38:40 +0100 Subject: build: configure svgr to use svg as components --- next.config.js | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) (limited to 'next.config.js') diff --git a/next.config.js b/next.config.js index f7b37d6..9c2debe 100644 --- a/next.config.js +++ b/next.config.js @@ -8,10 +8,36 @@ module.exports = { }, reactStrictMode: true, webpack: (config) => { - config.module.rules.push({ - test: /\.po/, - use: ['@lingui/loader'], - }); + config.module.rules.push( + { + test: /\.po/, + use: ['@lingui/loader'], + }, + { + test: /\.svg$/, + use: [ + { + loader: '@svgr/webpack', + options: { + svgoConfig: { + plugins: [ + { + name: 'preset-default', + params: { + overrides: { + removeTitle: false, + removeViewBox: false, + }, + }, + }, + 'removeDimensions', + ], + }, + }, + }, + ], + } + ); return config; }, -- cgit v1.2.3