File tree Expand file tree Collapse file tree 4 files changed +13
-2
lines changed
packages/open-next/src/adapters Expand file tree Collapse file tree 4 files changed +13
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " open-next " : patch
3
+ ---
4
+
5
+ Set default NODE_ENV to production
Original file line number Diff line number Diff line change @@ -18,9 +18,10 @@ import {
18
18
ImageOptimizerCache ,
19
19
// @ts -ignore
20
20
} from "next/dist/server/image-optimizer" ;
21
- import { loadConfig } from "./util.js" ;
21
+ import { loadConfig , setNodeEnv } from "./util.js" ;
22
22
import { debug } from "./logger.js" ;
23
23
24
+ setNodeEnv ( ) ;
24
25
const bucketName = process . env . BUCKET_NAME ;
25
26
const nextDir = path . join ( __dirname , ".next" ) ;
26
27
const config = loadConfig ( nextDir ) ;
Original file line number Diff line number Diff line change @@ -11,11 +11,12 @@ import type {
11
11
} from "aws-lambda" ;
12
12
// @ts -ignore
13
13
import NextServer from "next/dist/server/next-server.js" ;
14
- import { loadConfig } from "./util.js" ;
14
+ import { loadConfig , setNodeEnv } from "./util.js" ;
15
15
import { isBinaryContentType } from "./binary.js" ;
16
16
import { debug } from "./logger.js" ;
17
17
import type { PublicAssets } from "../build.js" ;
18
18
19
+ setNodeEnv ( ) ;
19
20
setNextjsServerWorkingDirectory ( ) ;
20
21
const nextDir = path . join ( __dirname , ".next" ) ;
21
22
const openNextDir = path . join ( __dirname , ".open-next" ) ;
Original file line number Diff line number Diff line change 1
1
import fs from "node:fs" ;
2
2
import path from "node:path" ;
3
3
4
+ export function setNodeEnv ( ) {
5
+ process . env . NODE_ENV = process . env . NODE_ENV ?? "production" ;
6
+ }
7
+
4
8
export function loadConfig ( nextDir : string ) {
5
9
const filePath = path . join ( nextDir , "required-server-files.json" ) ;
6
10
const json = fs . readFileSync ( filePath , "utf-8" ) ;
You can’t perform that action at this time.
0 commit comments