Skip to content

Commit

Permalink
feat(remix-dev): deprecate serverBuildTarget
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey committed Jan 18, 2023
1 parent d593e4a commit efca105
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 18 deletions.
26 changes: 20 additions & 6 deletions docs/file-conventions/remix-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ module.exports = {
});
},
serverBuildPath: "build/index.js",
serverBuildTarget: "node-cjs",
};
```

Expand Down Expand Up @@ -111,13 +110,16 @@ The path to the server build, relative to `remix.config.js`. Defaults to
## serverBuildPath

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.

If omitted, the default build path will be based on your
[`serverBuildTarget`][server-build-target].
should end in a `.js` extension and should be deployed to your server. Defaults
to `"build/index.js"`.

## serverBuildTarget

<docs-warning>This option is deprecated and will likely be removed in a future
stable release. Use [`publicPath`][public-path],
[`serverBuildPath`][server-build-path], [`serverModuleFormat`][server-module-format]
& [`serverPlatform`][server-platform] instead.</docs-warning>

The target of the server build. Defaults to `"node-cjs"`.

The `serverBuildTarget` can be one of the following:
Expand Down Expand Up @@ -153,6 +155,16 @@ module.exports = {
};
```

## serverModuleFormat

The output format of the server build, which can either be `"cjs"` or `"esm"`.
Defaults to `"cjs"`.

## serverPlatform

The platform the server build is targeting, which can either be `"neutral"` or
`"node"`. Defaults to `"node"`.

## watchPaths

An array, string, or async function that defines custom directories, relative to the project root, to watch while running [remix dev][remix-dev]. These directories are in addition to [`appDirectory`][app-directory].
Expand All @@ -173,8 +185,10 @@ There are a few conventions that Remix uses you should be aware of.
<docs-info>[Dilum Sanjaya][dilum-sanjaya] made [an awesome visualization][an-awesome-visualization] of how routes in the file system map to the URL in your app that might help you understand these conventions.</docs-info>

[minimatch]: https://www.npmjs.com/package/minimatch
[public-path]: #publicpath
[server-build-path]: #serverbuildpath
[server-build-target]: #serverbuildtarget
[server-module-format]: #servermoduleformat
[server-platform]: #serverplatform
[arc]: https://arc.codes
[cloudflare-pages]: https://pages.cloudflare.com
[cloudflare-workers]: https://workers.cloudflare.com
Expand Down
20 changes: 8 additions & 12 deletions packages/remix-dev/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,13 @@ export interface AppConfig {
* The path to the server build, relative to `remix.config.js`. Defaults to
* "build".
*
* @deprecated Use {@link ServerConfig.serverBuildPath} instead.
* @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.
*
* If omitted, the default build path will be based on your
* {@link ServerConfig.serverBuildTarget}.
*/
serverBuildPath?: string;

Expand All @@ -93,7 +90,7 @@ export interface AppConfig {
* The path to the browser build, relative to remix.config.js. Defaults to
* "public/build".
*
* @deprecated Use `{@link ServerConfig.assetsBuildDirectory}` instead
* @deprecated Use `{@link AppConfig.assetsBuildDirectory}` instead
*/
browserBuildDirectory?: string;

Expand Down Expand Up @@ -121,20 +118,18 @@ export interface AppConfig {

/**
* The output format of the server build. Defaults to "cjs".
*
* @deprecated Use {@link ServerConfig.serverBuildTarget} instead.
*/
serverModuleFormat?: ServerModuleFormat;

/**
* The platform the server build is targeting. Defaults to "node".
*
* @deprecated Use {@link ServerConfig.serverBuildTarget} instead.
*/
serverPlatform?: ServerPlatform;

/**
* The target of the server build. Defaults to "node-cjs".
*
* @deprecated Use a combination of {@link AppConfig.publicPath}, {@link AppConfig.serverBuildPath}, {@link AppConfig.serverModuleFormat} & {@link AppConfig.serverPlatform} instead.
*/
serverBuildTarget?: ServerBuildTarget;

Expand Down Expand Up @@ -206,8 +201,7 @@ export interface RemixConfig {
routes: RouteManifest;

/**
* The path to the server build file. This file should end in a `.js`. Defaults
* are based on {@link ServerConfig.serverBuildTarget}.
* The path to the server build file. This file should end in a `.js`.
*/
serverBuildPath: string;

Expand Down Expand Up @@ -257,7 +251,9 @@ export interface RemixConfig {
serverPlatform: ServerPlatform;

/**
* The target of the server build.
* The target of the server build. Defaults to "node-cjs".
*
* @deprecated Use a combination of {@link RemixConfig.publicPath}, {@link RemixConfig.serverBuildPath}, {@link RemixConfig.serverModuleFormat} & {@link RemixConfig.serverPlatform} instead.
*/
serverBuildTarget?: ServerBuildTarget;

Expand Down

0 comments on commit efca105

Please sign in to comment.