-
Notifications
You must be signed in to change notification settings - Fork 13
/
next.config.js
85 lines (77 loc) · 2.1 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
const { createVanillaExtractPlugin } = require('@vanilla-extract/next-plugin')
const withVanillaExtract = createVanillaExtractPlugin()
const { withSentryConfig } = require('@sentry/nextjs')
const SentryWebpackPlugin = require('@sentry/webpack-plugin')
// const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin')
// const { VanillaExtractPlugin } = require('@vanilla-extract/webpack-plugin')
const { NEXT_PUBLIC_SENTRY_DSN, SENTRY_ORG, SENTRY_PROJECT } = process.env
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
sentry: {
hideSourceMaps: true,
disableServerWebpackPlugin: true,
},
// experimental: { // @BJ: disabled due to out-of-mem errors
// esmExternals: false,
// },
images: {
domains: [
// For debugging images
'source.unsplash.com',
'zora-dev.mypinata.cloud',
],
},
webpack: (config, options) => {
config.module.rules.push({
test: /\.(ts)?$/,
use: [
{
loader: 'ts-loader',
options: {
transpileOnly: true,
experimentalWatchApi: true,
onlyCompileBundledFiles: true,
},
},
],
})
config.module.rules.push({
test: /\.(md|mdx)?$/,
use: [
{
loader: '@mdx-js/loader',
/** @type {import('@mdx-js/loader').Options} */
options: {},
},
],
})
if (NEXT_PUBLIC_SENTRY_DSN && SENTRY_ORG && SENTRY_PROJECT) {
config.plugins.push(
new SentryWebpackPlugin({
include: '.next',
ignore: ['node_modules'],
urlPrefix: '~/_next',
})
)
}
// config.plugins.push(
// new ForkTsCheckerWebpackPlugin({
// typescript: {
// diagnosticOptions: {
// semantic: true,
// syntactic: true,
// },
// },
// }),
// new VanillaExtractPlugin()
// )
return config
},
}
const sentryWebpackPluginOptions = {
silent: false,
}
module.exports = withVanillaExtract(
withSentryConfig(nextConfig, sentryWebpackPluginOptions)
)