From 43ec6afb54833fd5431ded382b3c1d980f464f08 Mon Sep 17 00:00:00 2001 From: Mark Dalgleish Date: Mon, 19 Jun 2023 15:43:44 +1000 Subject: [PATCH] fix(dev): skip unused Node polyfills in CSS build (#6639) --- .changeset/css-bundle-skip-node-polyfills.md | 5 +++++ packages/remix-dev/compiler/css/compiler.ts | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 .changeset/css-bundle-skip-node-polyfills.md diff --git a/.changeset/css-bundle-skip-node-polyfills.md b/.changeset/css-bundle-skip-node-polyfills.md new file mode 100644 index 00000000000..8e7ab433e61 --- /dev/null +++ b/.changeset/css-bundle-skip-node-polyfills.md @@ -0,0 +1,5 @@ +--- +"@remix-run/dev": patch +--- + +Improve CSS bundle build performance by skipping unused Node polyfills diff --git a/packages/remix-dev/compiler/css/compiler.ts b/packages/remix-dev/compiler/css/compiler.ts index b6e1407a40f..9517a3aa9e5 100644 --- a/packages/remix-dev/compiler/css/compiler.ts +++ b/packages/remix-dev/compiler/css/compiler.ts @@ -1,6 +1,5 @@ import { builtinModules as nodeBuiltins } from "module"; import * as esbuild from "esbuild"; -import { nodeModulesPolyfillPlugin } from "esbuild-plugins-node-modules-polyfill"; import type { RemixConfig } from "../../config"; import { getAppDependencies } from "../../dependencies"; @@ -81,7 +80,6 @@ const createEsbuildConfig = (ctx: Context): esbuild.BuildOptions => { externalPlugin(/^https?:\/\//, { sideEffects: false }), mdxPlugin(ctx), emptyModulesPlugin(ctx, /\.server(\.[jt]sx?)?$/), - nodeModulesPolyfillPlugin(), externalPlugin(/^node:.*/, { sideEffects: false }), ], supported: {