You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/pages/config.mdx
+4-102Lines changed: 4 additions & 102 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,108 +7,10 @@ There is a single build argument that you can pass to the `open-next build` comm
7
7
8
8
For personalisation you need to create a file `open-next.config.ts` at the same place as your `next.config.js`, and export a default object that satisfies the `OpenNextConfig` interface.
9
9
10
-
Here is a detailed example of an `open-next.config.ts` file:
11
-
This file need to be at the same place as your `next.config.js` file
10
+
This file needs to be placed at the same level as your `next.config.js` file.
12
11
13
-
`server` in here could refer to a lambda function, a docker container, a node server or whatever that can support running nodejs code. (Even cloudflare workers in the future)
12
+
If you want to take a look at some simple configuration examples, you can check the [simple example](/config/simple_example).
14
13
15
-
For more information about the options here, take a look at the [components section](/components/overview).
14
+
For more advanced use cases, you can check [how to implement custom overrides](/config/custom_overrides).
// This is necessary to generate the dockerfile and for the implementation to know that it needs to deploy on docker
59
-
// You can also provide a string here which will be used to create the dockerfile
60
-
generateDockerfile: true,
61
-
},
62
-
},
63
-
edge: {
64
-
runtime: "edge",
65
-
routes: ["app/ssr/page"],
66
-
patterns: ["ssr"],
67
-
override: {}
68
-
}
69
-
},
70
-
// By setting this, it will create another bundle for the middleware,
71
-
// and the middleware will be deployed in a separate server.
72
-
// If not set middleware will be bundled inside the servers
73
-
// It could be in lambda@edge, cloudflare workers, or anywhere else
74
-
// By default it uses lambda@edge
75
-
// This is not implemented in the reference construct implementation.
76
-
// This is optional, but might be necessary if you split your app into multiple servers
77
-
middleware: {
78
-
external: true
79
-
}
80
-
81
-
// Optional
82
-
imageOptimization: {
83
-
// This is the architecture of the image, it could be x64 or arm64
84
-
// This is necessary to bundle the proper version of sharp
85
-
arch: "x64",
86
-
}
87
-
88
-
// If you want to override the default build command, you can do it here
89
-
// By default it uses `npm run build`
90
-
buildCommand: "echo 'hello world'",
91
-
92
-
dangerous: {
93
-
// This will disable the tag cache
94
-
// You can use it safely on page router, on app router it will break revalidateTag and revalidatePath
95
-
disableTagCache: true,
96
-
// This will disable the incremental cache
97
-
// This is generally not recommended, as this is necessary for ISR AND SSG routes as well as the fetch cache
98
-
disableIncrementalCache: true,
99
-
}
100
-
101
-
//The path to the target folder of build output from the `buildCommand` option (the path which will contain the `.next` and `.open-next` folders). This path is relative from the current process.cwd() - Optional default to "."
102
-
buildOutputPath: "build",
103
-
104
-
//The path to the root of the Next.js app's source code. This path is relative from the current process.cwd(). - Optional default to "."
105
-
appPath: "app",
106
-
107
-
//The path to the package.json file of the Next.js app. This path is relative from the current process.cwd(). - Optional
108
-
packageJsonPath: "package.json",
109
-
110
-
} satisfiesOpenNextConfig
111
-
112
-
exportdefaultconfig;
113
-
exporttypeConfig=typeofconfig
114
-
```
16
+
If you want to look at a full example, you can check [the full example](/config/full_example).
0 commit comments