Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add --outbase option #471

Merged
merged 2 commits into from
Nov 1, 2020
Merged

add --outbase option #471

merged 2 commits into from
Nov 1, 2020

Conversation

nitsky
Copy link
Contributor

@nitsky nitsky commented Oct 18, 2020

Currently, esbuild uses the lowest common ancestor of the entrypoints to determine where to place each entrypoint's output file. This is an excellent default, but is not ideal in some situations. Take for example an app with a folder structure similar to Next.js, with js files at pages/a/b/c.js and pages/a/b/d.js. These two files correspond to the paths /a/b/c and /a/b/d. Ideally, esbuild would emit out/a/b/c.js and out/a/b/d.js. However, esbuild identifies pages/a/b as the lowest common ancestor and emits out/c.js and out/d.js. This PR introduces a --outbase argument to the cli that allows the user to choose which path to base entrypoint output paths on. With this change, running esbuild with --outbase=pages results in the desired behavior.

@evanw
Copy link
Owner

evanw commented Nov 1, 2020

This addition makes sense to me 👍

@evanw evanw merged commit 38d1a19 into evanw:master Nov 1, 2020
evanw added a commit that referenced this pull request Nov 1, 2020
evanw added a commit that referenced this pull request Nov 1, 2020
@nitsky nitsky deleted the outbase branch November 4, 2020 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants