Skip to content
This repository has been archived by the owner on May 7, 2023. It is now read-only.

Commit

Permalink
Update webpack config
Browse files Browse the repository at this point in the history
  • Loading branch information
hyochan committed Dec 19, 2021
1 parent d16ecd0 commit 5a5601e
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions client/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,24 @@ module.exports = async (env, argv) => {
};

// Add new rule to use svgr
// Place at the beginning so that the default loader doesn't catch it
if (hasModified)
newRule.oneOf.unshift({
test: /\.svg$/,
exclude: /node_modules/,
use: [
{
loader: '@svgr/webpack',
rule.oneOf.unshift({
test: /\.svg$/,
exclude: /node_modules/,
use: [
{
loader: require.resolve('@svgr/webpack'),
options: {
viewBox: false,
},
],
});
},
],
});

return newRule;
} else return rule;
});

config.resolve.extensions.push('.svg');

return config;
};

0 comments on commit 5a5601e

Please sign in to comment.