diff --git a/.changeset/tame-moons-buy.md b/.changeset/tame-moons-buy.md new file mode 100644 index 00000000000..ea0a7e03760 --- /dev/null +++ b/.changeset/tame-moons-buy.md @@ -0,0 +1,5 @@ +--- +"@remix-run/dev": major +--- + +Remove `serverBuildDirectory` config option diff --git a/packages/remix-dev/config.ts b/packages/remix-dev/config.ts index 64ad86f0804..3adba9e7e27 100644 --- a/packages/remix-dev/config.ts +++ b/packages/remix-dev/config.ts @@ -127,14 +127,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. @@ -429,7 +421,10 @@ export async function readConfig( headersWarning(); } - let serverBuildPath = resolveServerBuildPath(rootDirectory, appConfig); + let serverBuildPath = path.resolve( + rootDirectory, + appConfig.serverBuildPath ?? "build/index.js" + ); let serverBuildTargetEntryModule = `export * from ${JSON.stringify( serverBuildVirtualModule.id )};`; @@ -882,26 +877,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) { - serverBuildDirectoryWarning(); - - serverBuildPath = path.join(appConfig.serverBuildDirectory, "index.js"); - } - - if (appConfig.serverBuildPath) { - serverBuildPath = appConfig.serverBuildPath; - } - - return path.resolve(rootDirectory, serverBuildPath); -}; - // adds types for `Intl.ListFormat` to the global namespace // we could also update our `tsconfig.json` to include `lib: ["es2021"]` declare namespace Intl { @@ -939,18 +914,6 @@ let disjunctionListFormat = new Intl.ListFormat("en", { type: "disjunction", }); -let serverBuildDirectoryWarning = () => - logger.warn( - "The `serverBuildDirectory` config option will be removed in v2", - { - details: [ - "You can use the `serverBuildPath` config option instead.", - "-> https://remix.run/docs/en/v1.15.0/pages/v2#serverbuilddirectory", - ], - key: "serverBuildDirectoryWarning", - } - ); - let serverModuleFormatWarning = () => logger.warn("The default server module format is changing in v2", { details: [