Skip to content

Commit

Permalink
fix(dev): skip unused Node polyfills in CSS build (#6639)
Browse files Browse the repository at this point in the history
  • Loading branch information
markdalgleish authored Jun 19, 2023
1 parent 25620b9 commit 43ec6af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/css-bundle-skip-node-polyfills.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/dev": patch
---

Improve CSS bundle build performance by skipping unused Node polyfills
2 changes: 0 additions & 2 deletions packages/remix-dev/compiler/css/compiler.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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: {
Expand Down

0 comments on commit 43ec6af

Please sign in to comment.