-
-
Notifications
You must be signed in to change notification settings - Fork 40
/
next.config.js
38 lines (37 loc) · 1006 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
const { PerfseePlugin } = require('@perfsee/webpack')
const withNextra = require('nextra')({
theme: 'nextra-theme-docs',
themeConfig: './nextra.config.js',
flexsearch: true,
staticImage: true,
})
module.exports = withNextra({
i18n: {
defaultLocale: process.env.LOCALE || 'en',
locales: ['en', 'cn', 'pt-BR'],
},
webpack(config, { dev, isServer }) {
if (!dev && !isServer) {
const plugin = new PerfseePlugin({
project: 'napi-rs-website',
artifactName: 'main',
})
config.devtool = 'hidden-nosources-source-map'
if (Array.isArray(config.plugins)) {
config.plugins.push(plugin)
} else {
config.plugins = [plugin]
}
}
config.module.rules.push({
test: /\.mp4$/,
loader: 'file-loader',
options: {
name: '[name]-[contenthash:8].[ext]',
publicPath: `/_next/static/videos/`,
outputPath: `${isServer ? '../' : ''}static/videos/`,
},
})
return config
},
})