2019-12-07 23:02:18 +01:00
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
const withSvgr = (nextConfig = {}, nextComposePlugins = {}) => {
|
|
|
|
return Object.assign({}, nextConfig, {
|
|
|
|
webpack(config, options) {
|
|
|
|
config.module.rules.push({
|
|
|
|
test: /\.svg$/,
|
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: '@svgr/webpack',
|
|
|
|
options: {
|
|
|
|
icon: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
})
|
|
|
|
|
|
|
|
if (typeof nextConfig.webpack === 'function') {
|
|
|
|
return nextConfig.webpack(config, options)
|
|
|
|
}
|
|
|
|
|
|
|
|
return config
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
const withBundleAnalyzer = require('@next/bundle-analyzer')({
|
|
|
|
enabled: process.env.ANALYZE === 'true'
|
|
|
|
})
|
|
|
|
|
2020-01-28 11:04:48 +01:00
|
|
|
module.exports = withBundleAnalyzer(withSvgr())
|