From 535669fff6af57cb1de980fb34f48fac37029df9 Mon Sep 17 00:00:00 2001 From: Mohammad Bagher Abiyat Date: Sat, 24 Feb 2024 08:27:52 +0330 Subject: [PATCH] fix: remix warnings (#969) * init * init * remove log * init --- packages/compiler/plugin.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/compiler/plugin.ts b/packages/compiler/plugin.ts index 3adaee41b2..201535a097 100644 --- a/packages/compiler/plugin.ts +++ b/packages/compiler/plugin.ts @@ -18,6 +18,8 @@ interface CompilerOutput { map: BabelFileResult['map']; } +let ssr = false + async function compile( id: string, code: string, @@ -25,6 +27,11 @@ async function compile( telemetryInstance: MillionTelemetry, isServer?: boolean, ): Promise { + if (isServer) { + // for frameworks like remix, even for client, we need to return react-server + ssr = true + } + displayIntro(options); const plugins: ParserOptions['plugins'] = [ @@ -52,7 +59,7 @@ async function compile( { telemetry: telemetryInstance, log: options.log, - server: isServer, + server: ssr, hmr: options.hmr, auto: options.auto, rsc: options.rsc,