-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
63 lines (59 loc) · 1.99 KB
/
next.config.js
File metadata and controls
63 lines (59 loc) · 1.99 KB
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
// import path from 'node:path'
// import { fileURLToPath } from 'node:url'
export default {
staticPageGenerationTimeout: 300,
images: {
// Cloudflare Pages does not support the Next.js image optimization API,
// so we serve images unoptimized and rely on Cloudflare's built-in Polish
// / image resizing at the CDN layer instead.
unoptimized: true,
remotePatterns: [
{ protocol: 'https', hostname: 'www.notion.so' },
{ protocol: 'https', hostname: 'notion.so' },
{ protocol: 'https', hostname: 'images.unsplash.com' },
{ protocol: 'https', hostname: 'abs.twimg.com' },
{ protocol: 'https', hostname: 'pbs.twimg.com' },
{ protocol: 'https', hostname: 's3.us-west-2.amazonaws.com' }
],
formats: ['image/avif', 'image/webp'],
dangerouslyAllowSVG: true,
contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox;"
},
// webpack: (config) => {
// // Workaround for ensuring that `react` and `react-dom` resolve correctly
// // when using a locally-linked version of `react-notion-x`.
// // @see https://github.com/vercel/next.js/issues/50391
// const dirname = path.dirname(fileURLToPath(import.meta.url))
// config.resolve.alias.react = path.resolve(dirname, 'node_modules/react')
// config.resolve.alias['react-dom'] = path.resolve(
// dirname,
// 'node_modules/react-dom'
// )
// return config
// },
// Transpile all runtime deps so Next 16's Turbopack doesn't externalize them.
// OpenNext/Cloudflare Workers has no node_modules at runtime — transpiling inlines them.
transpilePackages: [
'@fisch0920/use-dark-mode',
'@keyvhq/core',
'@keyvhq/redis',
'classnames',
'expiry-map',
'fathom-client',
'katex',
'ky',
'notion-client',
'notion-types',
'notion-utils',
'nprogress',
'p-map',
'p-memoize',
'posthog-js',
'prismjs',
'react-body-classname',
'react-notion-x',
'react-tweet',
'react-use',
'rss'
]
}