evanw / evanw/esbuild

Feature Request: Ability to disable 0.19's more aggressive string-interpolation-and-fs-matching-based bundling

Open
#3,337 1 comment 14 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
40.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

We use esbuild in Cloudflare's CLI, [Wrangler](https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler). We have a lot of custom logic around module collection and need great control over which files are bundled so that we're able to take advantage of features like dynamic imports in our runtime, [workerd](https://github.com/cloudflare/workerd). Our users benefit from small entrypoints because this reduces the startup time of their Workers.

We often still want to enable esbuild's bundling because we either need to apply some sort of processing to the file (e.g. shimming it with a facade), or we want to control exactly where the lazy-loading dynamic import boundary is ourselves.

We can't always control how users and frameworks write their import statements (i.e. we can't ask them to avoid doing string interpolation inline), so we are currently unable to upgrade to 0.19 of esbuild.

We'd love to see a feature which allows us to disable the "Run-time import paths" feature which tries to bundle string interpolated paths by inspecting the filesystem.

If you'd support this feature but don't have time to work on it yourself, please still let us know and we'd be happy to take a look at implementing it.

Thank you for considering this, and for all your work on esbuild!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating esbuild's implementation of the "Run-time import paths" behavior and the configuration entry points for bundling options. Read how string-interpolated paths are currently inspected and define an opt-out that preserves other bundling and processing behavior. Done means callers can disable this behavior without disabling bundling generally.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, javascript
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.