From 316ccbac5727fab5122ef3c68e5c2a79bfc7d130 Mon Sep 17 00:00:00 2001 From: Quinn Slack Date: Sun, 29 Jan 2023 00:40:20 -0800 Subject: [PATCH] make DEV_WEB_BUILDER_OMIT_SLOW_DEPS work with pnpm (#47067) The DEV_WEB_BUILDER_OMIT_SLOW_DEPS env var is an experimental dev env var for faster builds that I sometimes use. When using it, the packageResolution plugin needs the same fix as the one for stylePlugin in https://github.com/sourcegraph/sourcegraph/pull/46452 to work with pnpm. This is a generally sensible fix that implements the correct and desirable behavior, not just a way to make a hack work. --- client/build-config/src/esbuild/packageResolutionPlugin.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/build-config/src/esbuild/packageResolutionPlugin.ts b/client/build-config/src/esbuild/packageResolutionPlugin.ts index 20556aae7cd..a4990d169ce 100644 --- a/client/build-config/src/esbuild/packageResolutionPlugin.ts +++ b/client/build-config/src/esbuild/packageResolutionPlugin.ts @@ -3,7 +3,7 @@ import fs from 'fs' import { CachedInputFileSystem, ResolverFactory } from 'enhanced-resolve' import * as esbuild from 'esbuild' -import { NODE_MODULES_PATH } from '../paths' +import { NODE_MODULES_PATH, WORKSPACE_NODE_MODULES_PATHS } from '../paths' interface Resolutions { [fromModule: string]: string @@ -22,7 +22,7 @@ export const packageResolutionPlugin = (resolutions: Resolutions): esbuild.Plugi fileSystem: new CachedInputFileSystem(fs, 4000), extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'], symlinks: true, // Resolve workspace symlinks - modules: [NODE_MODULES_PATH], + modules: [NODE_MODULES_PATH, ...WORKSPACE_NODE_MODULES_PATHS], unsafeCache: true, })