From bf042e7d340b3cbfdaa389c201e1284fb4d03403 Mon Sep 17 00:00:00 2001 From: Pedro Cattori Date: Tue, 29 Aug 2023 13:06:32 -0400 Subject: [PATCH] compile server build to node 18 (#7292) --- .changeset/young-pants-buy.md | 7 +++++++ packages/remix-dev/compiler/server/compiler.ts | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/young-pants-buy.md diff --git a/.changeset/young-pants-buy.md b/.changeset/young-pants-buy.md new file mode 100644 index 00000000000..264afa56f28 --- /dev/null +++ b/.changeset/young-pants-buy.md @@ -0,0 +1,7 @@ +--- +"@remix-run/dev": major +--- + +Compile server build to Node 18. + +This allows features like top-level `await` to be used within a Remix app. diff --git a/packages/remix-dev/compiler/server/compiler.ts b/packages/remix-dev/compiler/server/compiler.ts index 3280b32092d..1fbfd76ae9c 100644 --- a/packages/remix-dev/compiler/server/compiler.ts +++ b/packages/remix-dev/compiler/server/compiler.ts @@ -88,7 +88,7 @@ const createEsbuildConfig = ( minifySyntax: true, minify: ctx.options.mode === "production" && ctx.config.serverMinify, mainFields: ctx.config.serverMainFields, - target: "node14", + target: "node18", loader: loaders, bundle: true, logLevel: "silent",