Skip to content

Commit

Permalink
feat!(remix-dev): remove serverBuildDirectory config
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey committed Mar 16, 2023
1 parent 2f095cd commit 0b572a3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 33 deletions.
5 changes: 5 additions & 0 deletions .changeset/tame-moons-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/dev": major
---

remove `serverBuildDirectory` config
37 changes: 4 additions & 33 deletions packages/remix-dev/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
)};`;
Expand Down Expand Up @@ -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", {
Expand All @@ -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`, " +
Expand Down

0 comments on commit 0b572a3

Please sign in to comment.