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(define): will not replace define if it is literal. #9621

Closed
wants to merge 5 commits into from

Conversation

BTBMan
Copy link

@BTBMan BTBMan commented Aug 11, 2022

Description

Fix #3304

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 Commit 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.

Signed-off-by: BTBMan <1498118157@qq.com>
Signed-off-by: BTBMan <1498118157@qq.com>
Signed-off-by: BTBMan <1498118157@qq.com>
@BTBMan BTBMan changed the title fix(define): will not replace define variable if it is literal. fix(define): will not replace define if it is literal. Aug 11, 2022
Signed-off-by: BTBMan <1498118157@qq.com>
Signed-off-by: BTBMan <1498118157@qq.com>
@patak-dev
Copy link
Member

Thanks for the PR. Vite's define is regex based for performance reasons. We need to avoid a full JS parsing step only for this plugin, so I think we aren't going to be able to move forward with this approach.

@BTBMan
Copy link
Author

BTBMan commented Aug 16, 2022

Ok, Thanks for reply.

@BTBMan BTBMan closed this Aug 16, 2022
@BTBMan BTBMan deleted the import-meta branch January 13, 2023 06:17
@BTBMan BTBMan restored the import-meta branch October 3, 2023 06:16
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.

Project build failed with "import.meta.env"
2 participants