2019-10-16 22:10:03 +02:00
|
|
|
const withCSS = require('@zeit/next-css')
|
2019-10-18 13:10:43 +02:00
|
|
|
const withMDX = require('@next/mdx')()
|
2019-10-16 22:10:03 +02:00
|
|
|
|
2019-10-21 11:52:51 +02:00
|
|
|
// eslint-disable-next-line no-unused-vars
|
2019-10-16 22:10:03 +02:00
|
|
|
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
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = withSvgr(
|
2019-10-18 13:10:43 +02:00
|
|
|
withMDX(
|
|
|
|
withCSS({
|
|
|
|
cssModules: true,
|
|
|
|
cssLoaderOptions: {
|
|
|
|
localIdentName: '[local]___[hash:base64:5]'
|
|
|
|
}
|
|
|
|
})
|
|
|
|
)
|
2019-10-16 22:10:03 +02:00
|
|
|
)
|