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

inject has higher priority than define #660

Closed
remorses opened this issue Jan 11, 2021 · 0 comments · Fixed by #1261
Closed

inject has higher priority than define #660

remorses opened this issue Jan 11, 2021 · 0 comments · Fixed by #1261
Labels

Comments

@remorses
Copy link
Contributor

remorses commented Jan 11, 2021

The identifiers for options.define should be replaced before injecting modules in options.inject

Another way to put this: define identifiers should have higher priority than exports in inject

This would prevent many injections from running, for example replacing occurrences of process.env.VAR with define could skip the injection of a ./process.js module

Currently the injections are run first, which also means that the identifiers in define are never used if they are properties of an object exported from a module in inject

Reproduction: https://github.com/remorses/esbuild-inject-overrides-defines

@remorses remorses changed the title Replace identifiers for define before using inject Replace identifiers for define before doing inject Jan 11, 2021
@remorses remorses changed the title Replace identifiers for define before doing inject inject has higher priority than define Jan 12, 2021
@evanw evanw added the breaking label Mar 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants