-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.js
36 lines (32 loc) · 1001 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
36
const linguiConfig = require('./lingui.config')
const withPlugins = require('next-compose-plugins')
const withExportImages = require('next-export-optimize-images')
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})
/** @type {import('next').NextConfig} */
module.exports = withPlugins(
process.env.EXPORT === 'true' ? [withExportImages, withBundleAnalyzer] : [withBundleAnalyzer],
{
output: process.env.STANDALONE ? 'standalone' : process.env.EXPORT ? 'export' : undefined,
reactStrictMode: true,
swcMinify: true,
transpilePackages: ['@uidotdev', '@heroicons'],
experimental: {
swcPlugins: [['@lingui/swc-plugin', {}]],
},
i18n: {
locales: linguiConfig.locales,
defaultLocale: linguiConfig.sourceLocale,
},
webpack: (config) => {
config.module.rules.push({
test: /\.po$/,
use: {
loader: '@lingui/loader', // https://github.com/lingui/js-lingui/issues/1782
},
})
return config
},
}
)