mirror of
https://github.com/kremalicious/ipfs.git
synced 2024-11-21 17:27:06 +01:00
config refactor
This commit is contained in:
parent
bb65ade4da
commit
2c98082c1c
@ -1,30 +1,23 @@
|
|||||||
// eslint-disable-next-line no-unused-vars
|
module.exports = (phase, { defaultConfig }) => {
|
||||||
const withSvgr = (nextConfig = {}, nextComposePlugins = {}) => {
|
/**
|
||||||
return Object.assign({}, nextConfig, {
|
* @type {import('next').NextConfig}
|
||||||
webpack(config, options) {
|
*/
|
||||||
|
const nextConfig = {
|
||||||
|
webpack: (config, options) => {
|
||||||
config.module.rules.push({
|
config.module.rules.push({
|
||||||
test: /\.svg$/,
|
test: /\.svg$/,
|
||||||
use: [
|
use: [{ loader: '@svgr/webpack', options: { icon: true } }]
|
||||||
{
|
|
||||||
loader: '@svgr/webpack',
|
|
||||||
options: {
|
|
||||||
icon: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
|
return typeof defaultConfig.webpack === 'function'
|
||||||
if (typeof nextConfig.webpack === 'function') {
|
? defaultConfig.webpack(config, options)
|
||||||
return nextConfig.webpack(config, options)
|
: config
|
||||||
}
|
},
|
||||||
|
bundleAnalyzer: () =>
|
||||||
return config
|
require('@next/bundle-analyzer')({
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const withBundleAnalyzer = require('@next/bundle-analyzer')({
|
|
||||||
enabled: process.env.ANALYZE === 'true'
|
enabled: process.env.ANALYZE === 'true'
|
||||||
})
|
}),
|
||||||
|
reactStrictMode: true
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = withSvgr(withBundleAnalyzer())
|
return nextConfig
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user