2022-06-10 23:58:18 +00:00
|
|
|
const { i18n } = require("./next-i18next.config")
|
|
|
|
|
|
|
|
|
|
|
|
function fixCssLoaderLocalIdent(webpackConfig) {
|
|
|
|
|
|
|
|
function innerFix(used) {
|
|
|
|
|
2022-06-11 03:08:49 +00:00
|
|
|
if (used.loader?.match?.(/.*[/]css-loader.*/)) {
|
2022-06-10 23:58:18 +00:00
|
|
|
|
2022-06-11 03:08:49 +00:00
|
|
|
if (used.options?.modules) {
|
2022-06-10 23:58:18 +00:00
|
|
|
|
2022-06-11 03:08:49 +00:00
|
|
|
if (used.options.modules.getLocalIdent) {
|
2022-06-10 23:58:18 +00:00
|
|
|
|
2022-06-11 03:08:49 +00:00
|
|
|
used.options.modules.getLocalIdent = (context, localIdentName, localName) => `festa__${localName}`
|
|
|
|
|
|
|
|
}
|
2022-06-10 23:58:18 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return used
|
|
|
|
}
|
|
|
|
|
|
|
|
webpackConfig.module.rules = webpackConfig.module.rules.map(rule => {
|
|
|
|
|
|
|
|
if (rule.oneOf) {
|
|
|
|
|
|
|
|
rule.oneOf = rule.oneOf.map(one => {
|
|
|
|
|
|
|
|
if (one.use === undefined) {
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (Array.isArray(one.use)) {
|
|
|
|
one.use = one.use.map(innerFix)
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
one.use = innerFix(one.use)
|
|
|
|
}
|
|
|
|
|
|
|
|
return one
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
return rule
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
return webpackConfig
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function webpack(config) {
|
|
|
|
config = fixCssLoaderLocalIdent(config)
|
|
|
|
return config
|
|
|
|
}
|
|
|
|
|
2022-05-25 14:20:22 +00:00
|
|
|
|
2022-05-29 03:00:48 +00:00
|
|
|
/**
|
|
|
|
* @type {import('next').NextConfig}
|
|
|
|
*/
|
2022-05-20 11:59:24 +00:00
|
|
|
const nextConfig = {
|
2022-06-11 03:08:49 +00:00
|
|
|
experimental: { images: { layoutRaw: true } },
|
2022-06-04 03:13:19 +00:00
|
|
|
reactStrictMode: true,
|
2022-06-10 23:58:18 +00:00
|
|
|
webpack,
|
2022-06-04 03:13:19 +00:00
|
|
|
i18n,
|
2022-05-20 11:59:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = nextConfig
|