-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
34 lines (31 loc) · 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
const headers = [
{ key: 'X-DNS-Prefetch-Control', value: 'on' },
{ key: 'X-XSS-Protection', value: '1; mode=block' },
{ key: 'X-Frame-Options', value: 'SAMEORIGIN' },
{ key: 'X-Content-Type-Options', value: 'nosniff' },
{ key: 'Referrer-Policy', value: 'same-origin' },
{ key: 'Cloudflare-CDN-Cache-Control', value: 's-maxage=300 stale-while-revalidate=3600' },
]
/** @type {import('next').NextConfig} */
module.exports = {
reactStrictMode: true,
pageExtensions: ['page.tsx', 'page.ts', 'api.ts'],
poweredByHeader: false,
headers: async () => [
{ source: '/(.*)', headers: headers },
],
webpack: (config, { isServer }) => {
// load worker files as a urls by using Asset Modules
// https://webpack.js.org/guides/asset-modules/
if (!isServer) {
config.module.rules.unshift({
test: /pdf\.worker\.(min\.)?js/,
type: 'asset/resource',
generator: {
filename: 'static/worker/[hash][ext][query]',
},
})
}
return config
},
}