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";
33export const INSTRUMENTATION_TRACE_FILE = "server/instrumentation.js.nft.json" ;
44
55export 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+ */
813export const LOCAL_CONFIG = `export default {
914 default: {
1015 override: {
@@ -21,6 +26,8 @@ export const LOCAL_CONFIG = `export default {
2126 converter: "dummy",
2227 },
2328 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
2431 install: {
2532 arch: "x64",
2633 packages: ["sharp"],
Original file line number Diff line number Diff line change @@ -20,9 +20,9 @@ if (Object.keys(args).includes("--help")) printHelp();
2020
2121if ( command === "build" ) {
2222 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 " ) {
2626 await buildLocalConfig ( ) ;
2727 runLocally ( ) ;
2828}
@@ -78,7 +78,7 @@ function runLocally() {
7878 } ) ;
7979}
8080
81- function writeLocalConfig ( ) {
81+ function generateLocalConfig ( ) {
8282 if ( existsSync ( LOCAL_CONFIG_PATH ) ) {
8383 console . error (
8484 "open-next.config.local.ts already exists. Please remove it before running this command." ,
@@ -117,12 +117,12 @@ function printHelp() {
117117 ) ;
118118
119119 console . log ( "Other commands:" ) ;
120- console . log ( " local:run " ) ;
120+ console . log ( " preview " ) ;
121121 console . log (
122122 " Build and run OpenNext locally with open-next.config.local.ts" ,
123123 ) ;
124124
125- console . log ( " local:config " ) ;
125+ console . log ( " generate local" ) ;
126126 console . log (
127127 " Generate a config file with dev overrides for OpenNext in open-next.config.local.ts" ,
128128 ) ;
You can’t perform that action at this time.
0 commit comments