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

Commit

Permalink
chore: update how svgr is configured
Browse files Browse the repository at this point in the history
Signed-off-by: Logan McAnsh <[email protected]>
  • Loading branch information
mcansh committed Jun 18, 2020
1 parent 2f7b834 commit e81b09e
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 145 deletions.
27 changes: 2 additions & 25 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const withOffline = require('next-offline');
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
const withSVG = require('@mcansh/next-svgr')();

const { version, repository } = require('./package.json');

Expand Down Expand Up @@ -144,34 +145,10 @@ const nextConfig = {
};
}

config.module.rules.push({
test: /\.svg$/,
use: [
{
loader: '@svgr/webpack',
options: {
svgoConfig: {
plugins: [
{ removeViewBox: false },
{ removeDimensions: true },
{
prefixIds: {
delim: '_',
prefixIds: true,
prefixClassNames: false,
},
},
],
},
},
},
],
});

return config;
},
};

module.exports = withBundleAnalyzer(
withSourceMaps(withMDX(withOffline(nextConfig)))
withSourceMaps(withMDX(withOffline(withSVG(nextConfig))))
);
Loading

1 comment on commit e81b09e

@vercel
Copy link

@vercel vercel bot commented on e81b09e Jun 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.