-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
35 lines (31 loc) · 986 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
// @ts-check
/**
* @type {import('next').NextConfig}
* */
const nextConfig = {
/* config options here */
i18n: {
locales: ['en-US'],
defaultLocale: 'en-US',
},
webpack: (config, { isServer, dev }) => {
// https://github.com/vercel/next.js/discussions/11267#discussioncomment-2479112
// camel-case style names from css modules
config.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'
}
})
// Reduce the number of chunks so we ship a smaller first bundle.
// This should help reducing TBT
if (!isServer && !dev && config.optimization?.splitChunks) {
config.optimization.splitChunks.maxInitialRequests = 1
}
return config
},
}
module.exports = nextConfig