-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.js
42 lines (38 loc) · 1007 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
37
38
39
40
41
42
// @ts-check
const { withBlitz } = require("@blitzjs/next")
const linguiConfig = require("./lingui.config") // use Lingui config as single source of truth for defining locales
// NextJS bundle analyzer
const shouldAnalyzeBundles = process.env.ANALYZE === "true"
const withBundleAnalyzer = shouldAnalyzeBundles
? require("@next/bundle-analyzer")({ enabled: true })
: () => config
/**
* @type {import('@blitzjs/next').BlitzConfig}
**/
const config = {
experimental: {
// appDir: true,
swcPlugins: [
[
"@lingui/swc-plugin",
{
// the same options as in .swcrc
},
],
],
},
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
},
}
module.exports = withBlitz(withBundleAnalyzer(config))