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(plugin-legacy): always fallback legacy build when CSP #6535

Merged
merged 2 commits into from
Mar 21, 2022

Conversation

yoyo930021
Copy link
Contributor

@yoyo930021 yoyo930021 commented Jan 17, 2022

Description

Fixed #5919

Additional context

I use this answer to solve the problem of detecting dynamic imports needing eval.

Another answer also looks great, but we need a new file or allow data: in CSP, so I use the top answer.

You can use this project for test PR.
https://github.com/yoyo930021/vite-legacy-csp-bug

I test it in Edge 16, Edge 17, Edge 18, Chrome 62 with browserstack.


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.

@visualjerk
Copy link

We experience the same issue. Thanks for this PR!

@DesselBane
Copy link

Same here.

Copy link

@Jax-p Jax-p left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

wuzzeb added a commit to SeedTactics/fms-insight that referenced this pull request Mar 11, 2022
Could consider adding it back when vitejs/vite#6535 is merged
@mrbar42
Copy link

mrbar42 commented Mar 21, 2022

@sodatea Any chance pushing this forward?
is help needed in any way?

Copy link
Member

@haoqunjiang haoqunjiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have the environment to test it.
But the code looks good to me.

Copy link
Member

@patak-dev patak-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM too. Such a cool trick, thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

always fallback legacy build when CSP
8 participants