From 0b572a371d216995efb6aa738fd588c1bc0c09e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Wed, 8 Mar 2023 00:36:56 +0100 Subject: [PATCH] feat!(remix-dev): remove `serverBuildDirectory` config --- .changeset/tame-moons-buy.md | 5 +++++ packages/remix-dev/config.ts | 37 ++++-------------------------------- 2 files changed, 9 insertions(+), 33 deletions(-) create mode 100644 .changeset/tame-moons-buy.md diff --git a/.changeset/tame-moons-buy.md b/.changeset/tame-moons-buy.md new file mode 100644 index 00000000000..ff3d3c69ca0 --- /dev/null +++ b/.changeset/tame-moons-buy.md @@ -0,0 +1,5 @@ +--- +"@remix-run/dev": major +--- + +remove `serverBuildDirectory` config diff --git a/packages/remix-dev/config.ts b/packages/remix-dev/config.ts index 92df8d81313..4933ba07551 100644 --- a/packages/remix-dev/config.ts +++ b/packages/remix-dev/config.ts @@ -118,14 +118,6 @@ export interface AppConfig { */ server?: string; - /** - * The path to the server build, relative to `remix.config.js`. Defaults to - * "build". - * - * @deprecated Use {@link AppConfig.serverBuildPath} instead. - */ - serverBuildDirectory?: string; - /** * The path to the server build file, relative to `remix.config.js`. This file * should end in a `.js` extension and should be deployed to your server. @@ -382,7 +374,10 @@ export async function readConfig( warnOnce(errorBoundaryWarning, "v2_errorBoundary"); } - let serverBuildPath = resolveServerBuildPath(rootDirectory, appConfig); + let serverBuildPath = path.resolve( + rootDirectory, + appConfig.serverBuildPath ?? "build/index.js" + ); let serverBuildTargetEntryModule = `export * from ${JSON.stringify( serverBuildVirtualModule.id )};`; @@ -651,26 +646,6 @@ export function findConfig( return undefined; } -const resolveServerBuildPath = ( - rootDirectory: string, - appConfig: AppConfig -) => { - let serverBuildPath = "build/index.js"; - - // retain deprecated behavior for now - if (appConfig.serverBuildDirectory) { - warnOnce(serverBuildDirectoryWarning, "serverBuildDirectory"); - - serverBuildPath = path.join(appConfig.serverBuildDirectory, "index.js"); - } - - if (appConfig.serverBuildPath) { - serverBuildPath = appConfig.serverBuildPath; - } - - return path.resolve(rootDirectory, serverBuildPath); -}; - // @ts-expect-error available in node 12+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat#browser_compatibility let listFormat = new Intl.ListFormat("en", { @@ -682,10 +657,6 @@ export let browserBuildDirectoryWarning = "⚠️ DEPRECATED: The `browserBuildDirectory` config option is deprecated. " + "Use `assetsBuildDirectory` instead."; -export let serverBuildDirectoryWarning = - "⚠️ DEPRECATED: The `serverBuildDirectory` config option is deprecated. " + - "Use `serverBuildPath` instead."; - export let serverBuildTargetWarning = "⚠️ DEPRECATED: The `serverBuildTarget` config option is deprecated. Use a " + "combination of `publicPath`, `serverBuildPath`, `serverConditions`, " +