Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(remix-dev)!: remove serverBuildDirectory config option #6897

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 option
45 changes: 4 additions & 41 deletions packages/remix-dev/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
)};`;
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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: [
Expand Down