File tree Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -3,8 +3,13 @@ export const MIDDLEWARE_TRACE_FILE = "server/middleware.js.nft.json";
3
3
export const INSTRUMENTATION_TRACE_FILE = "server/instrumentation.js.nft.json" ;
4
4
5
5
export const LOCAL_CONFIG_PATH = "./open-next.config.local.ts" ;
6
- // This is an OpenNext config to run the default server function locally
7
- // https://opennext.js.org/aws/contribute/local_run
6
+ /*
7
+ * https://opennext.js.org/aws/contribute/local_run
8
+ * This is an OpenNext config to run the default server function locally
9
+ * Be aware that this will not work the same way as in production.
10
+ * Its mostly used for debugging and development purposes.
11
+ *
12
+ */
8
13
export const LOCAL_CONFIG = `export default {
9
14
default: {
10
15
override: {
@@ -21,6 +26,8 @@ export const LOCAL_CONFIG = `export default {
21
26
converter: "dummy",
22
27
},
23
28
loader: "fs-dev",
29
+ // This part is not needed on ARM Linux as it will be installed by default
30
+ // Currently only works on Linux machines
24
31
install: {
25
32
arch: "x64",
26
33
packages: ["sharp"],
Original file line number Diff line number Diff line change @@ -20,9 +20,9 @@ if (Object.keys(args).includes("--help")) printHelp();
20
20
21
21
if ( command === "build" ) {
22
22
await build ( args [ "--config-path" ] , args [ "--node-externals" ] ) ;
23
- } else if ( command === "local:config " ) {
24
- writeLocalConfig ( ) ;
25
- } else if ( command === "local:run " ) {
23
+ } else if ( command === "generate local" ) {
24
+ generateLocalConfig ( ) ;
25
+ } else if ( command === "preview " ) {
26
26
await buildLocalConfig ( ) ;
27
27
runLocally ( ) ;
28
28
}
@@ -78,7 +78,7 @@ function runLocally() {
78
78
} ) ;
79
79
}
80
80
81
- function writeLocalConfig ( ) {
81
+ function generateLocalConfig ( ) {
82
82
if ( existsSync ( LOCAL_CONFIG_PATH ) ) {
83
83
console . error (
84
84
"open-next.config.local.ts already exists. Please remove it before running this command." ,
@@ -117,12 +117,12 @@ function printHelp() {
117
117
) ;
118
118
119
119
console . log ( "Other commands:" ) ;
120
- console . log ( " local:run " ) ;
120
+ console . log ( " preview " ) ;
121
121
console . log (
122
122
" Build and run OpenNext locally with open-next.config.local.ts" ,
123
123
) ;
124
124
125
- console . log ( " local:config " ) ;
125
+ console . log ( " generate local" ) ;
126
126
console . log (
127
127
" Generate a config file with dev overrides for OpenNext in open-next.config.local.ts" ,
128
128
) ;
You can’t perform that action at this time.
0 commit comments