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

fix(esbuild): avoid polluting global namespace while minify is false #11882

Merged
merged 1 commit into from
Feb 1, 2023

Conversation

sun0day
Copy link
Member

@sun0day sun0day commented Feb 1, 2023

Description

fix #11641

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the PR Title Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@patak-dev
Copy link
Member

Thanks!

@patak-dev patak-dev merged commit c895379 into vitejs:main Feb 1, 2023
@matths
Copy link

matths commented Jan 9, 2024

I think, the global scope is still polluted by three variables. In one of our projects we even ran into problems with that. Minification renames one of those variables into v and because a script from another vendor has also such variable in global scope, we ran into an issue.
I have described the problem here: #15489 because the barrier to open an issue is quite high. I would appreciate some feedback on this.

@matths
Copy link

matths commented Apr 16, 2024

The problem still exists and sometimes collides even with $ jquery. :(

UPDATE: I more and more think, it is completely on the esbuild side of the story, as the adding of the helpers as well as the minification is on esbuild side. I found this issue over at esbuild: evanw/esbuild#3275 and did a comment.

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.

Vite library build is polluting global namespace
3 participants