generated from brocoders/extensive-react-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.mjs
52 lines (49 loc) · 1.83 KB
/
next.config.mjs
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
import path from 'path';
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: false,
eslint: {
dirs: ["src", "cypress/e2e"],
},
webpack(config) {
config.resolve.alias = {
...config.resolve.alias,
o1js: path.resolve('node_modules/o1js')
};
config.experiments = { ...config.experiments, topLevelAwait: true };
config.optimization.minimizer = [];
return config;
},
// To enable o1js for the web, we must set the COOP and COEP headers.
// See here for more information: https://docs.minaprotocol.com/zkapps/how-to-write-a-zkapp-ui#enabling-coop-and-coep-headers
async headers() {
return [
{
source: '/(.*)',
headers: [
{
key: 'Cross-Origin-Opener-Policy',
value: 'same-origin',
},
{
key: 'Cross-Origin-Embedder-Policy',
value: 'require-corp',
},
],
},
];
},
images: {
unoptimized: true,
},
/* Used to serve the Next.js app from a subdirectory (the GitHub repo name) and
* assetPrefix is used to serve assets (JS, CSS, images, etc.) from that subdirectory
* when deployed to GitHub Pages. The assetPrefix needs to be added manually to any assets
* if they're not loaded by Next.js' automatic handling (for example, in CSS files or in a <img> element).
* The 'ghp-postbuild.js' script in this project prepends the repo name to asset urls in the built css files
* after runing 'npm run deploy'.
*/
basePath: process.env.NODE_ENV === 'production' ? '/hello-world' : '', // update if your repo name changes for 'npm run deploy' to work successfully
assetPrefix: process.env.NODE_ENV === 'production' ? '/hello-world/' : '', // update if your repo name changes for 'npm run deploy' to work successfully
};
export default nextConfig;