Skip to content

Commit

Permalink
Fix docs for serverNodeBuiltinsPolyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Feb 6, 2024
1 parent b5d6b00 commit a5d10eb
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions docs/file-conventions/remix-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,19 @@ The path to the browser build, relative to remix.config.js. Defaults to

## browserNodeBuiltinsPolyfill

The Node.js polyfills to include in the browser build. Polyfills are provided by [JSPM][jspm] and configured via \[esbuild-plugins-node-modules-polyfill].
The Node.js polyfills to include in the browser build. Polyfills are provided by [JSPM][jspm] and configured via [esbuild-plugins-node-modules-polyfill].

```js filename=remix.config.js
exports.browserNodeBuiltinsPolyfill = {
modules: {
buffer: true, // Provide a JSPM polyfill
fs: "empty", // Provide an empty polyfill
},
globals: {
Buffer: true,
/** @type {import('@remix-run/dev').AppConfig} */
module.exports = {
browserNodeBuiltinsPolyfill: {
modules: {
buffer: true, // Provide a JSPM polyfill
fs: "empty", // Provide an empty polyfill
},
globals: {
Buffer: true,
},
},
};
```
Expand Down Expand Up @@ -208,7 +211,7 @@ Defaults to `"esm"`.

## serverNodeBuiltinsPolyfill

The Node.js polyfills to include in the server build when targeting non-Node.js server platforms. Polyfills are provided by [JSPM][jspm] and configured via [esbuild_plugins_node_modules_polyfill][esbuild_plugins_node_modules_polyfill].
The Node.js polyfills to include in the server build when targeting non-Node.js server platforms. Polyfills are provided by [JSPM][jspm] and configured via [esbuild-plugins-node-modules-polyfill].

```js filename=remix.config.js
/** @type {import('@remix-run/dev').AppConfig} */
Expand All @@ -218,9 +221,9 @@ module.exports = {
buffer: true, // Provide a JSPM polyfill
fs: "empty", // Provide an empty polyfill
},
},
globals: {
Buffer: true,
globals: {
Buffer: true,
},
},
};
```
Expand Down Expand Up @@ -271,7 +274,7 @@ There are a few conventions that Remix uses you should be aware of.
[postcss]: https://postcss.org
[tailwind_functions_and_directives]: https://tailwindcss.com/docs/functions-and-directives
[jspm]: https://github.com/jspm/jspm-core
[esbuild_plugins_node_modules_polyfill]: https://npm.im/esbuild-plugins-node-modules-polyfill
[esbuild-plugins-node-modules-polyfill]: https://npm.im/esbuild-plugins-node-modules-polyfill
[browser-node-builtins-polyfill]: #browsernodebuiltinspolyfill
[server-node-builtins-polyfill]: #servernodebuiltinspolyfill
[future-flags]: ../start/future-flags
Expand Down

0 comments on commit a5d10eb

Please sign in to comment.