-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
35 lines (29 loc) · 992 Bytes
/
next.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/**
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation.
* This is especially useful for Docker builds.
*/
//s!process.env.SKIP_ENV_VALIDATION && (await import('./src/env/server.mjs'));
const i18nConfig = require('./next-i18next.config.js');
const config = {
reactStrictMode: true,
swcMinify: true,
i18n: i18nConfig.i18n,
webpack: (config) => {
// add alias for scss folder
//config.resolve.alias['@scss'] = path.resolve(__dirname, 'src/scss');
// camel-case style names from css modules
/** @type any */
const webpackConfig = config;
webpackConfig.module.rules
.find(({ oneOf }) => !!oneOf)
.oneOf.filter(({ use }) => JSON.stringify(use)?.includes('css-loader'))
.reduce((acc, { use }) => acc.concat(use), [])
.forEach(({ options }) => {
if (options.modules) {
options.modules.exportLocalsConvention = 'camelCase';
}
});
return config;
},
};
module.exports = config;