-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
60 lines (58 loc) · 1.86 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/* eslint-disable @typescript-eslint/no-var-requires */
const withImages = require('next-images')
const withPrismaPlugin = require('next-prisma-plugin')
const { i18n } = require('./next-i18next.config')
module.exports = withImages(
withPrismaPlugin({
// TMP test to speed up dev
// webpack(pconfig, { dev }) {
// const config = pconfig
// if (dev) {
// config.devtool = 'cheap-module-source-map'
// }
// return config
// },
// next v12 feature
swcMinify: true,
i18n,
images: {
domains: ['res.cloudinary.com', 'img.youtube.com'],
// next v12 feature
formats: ['image/avif', 'image/webp'],
},
// next v12 feature (need react 18 alpha)
experimental: {
concurrentFeatures: true,
// serverComponents: true,
// other plugins
optimizeImages: true,
optimizeCss: true,
},
// typescript: {
// // !! WARN !!
// // Dangerously allow production builds to successfully complete even if
// // your project has type errors.
// // !! WARN !!
// ignoreBuildErrors: true,
// },
// eslint: {
// // Warning: This allows production builds to successfully complete even if
// // your project has ESLint errors.
// ignoreDuringBuilds: true,
// },
// Necessary for next-on-netlify to work correctly
target: process.env.NETLIFY ? 'experimental-serverless-trace' : undefined,
webpackDevMiddleware: (pconfig) => {
const config = pconfig
if (process.env.IS_DOCKER) {
// "next dev" in Docker doesn't reliably pick up file changes, so we need to enable polling
// see https://github.com/vercel/next.js/issues/6417 and https://webpack.js.org/configuration/watch/
config.watchOptions = {
...config.watchOptions,
poll: 500,
}
}
return config
},
})
)