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 ebf28f4c87c..ad1b7c37b65 100644 --- a/packages/remix-dev/config.ts +++ b/packages/remix-dev/config.ts @@ -109,14 +109,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. @@ -373,7 +365,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 )};`; @@ -635,26 +630,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", { @@ -662,10 +637,6 @@ let listFormat = new Intl.ListFormat("en", { type: "conjunction", }); -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`, " +