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

feat: dynamic import support ?url and ?worker #8261

Merged
merged 6 commits into from Sep 23, 2022

Conversation

poyoho
Copy link
Member

@poyoho poyoho commented May 21, 2022

Description

dynamic import support ?url and ?worker

feat test glob import for worker

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.

@poyoho poyoho added the p2-nice-to-have Not breaking anything but nice to have (priority) label May 21, 2022
@patak-dev
Copy link
Member

Let's discuss this in the next meeting. I'm not sure if we would like to keep expanding on the as syntax given that there is a chance it will change. I think the feature makes sense though, and users would be surprised if these modifiers don't work.

@patak-dev patak-dev added this to the 3.0 milestone May 21, 2022
@poyoho
Copy link
Member Author

poyoho commented May 22, 2022

The PR is not expanding on the as syntax, it use the as syntax in dynamic import and make the dynamic import keep same with import.meta.glob. May be we change the as syntax to other syntax, but I think the feature(?raw, ?url, ?worker) we will keep. We can change the import.meta.glob("./*.js", { as: 'url' }) to the new syntax.
And the user always use import(./${var}.js?url) to import assert url.

@patak-dev patak-dev removed this from the 3.0 milestone Jun 20, 2022
@patak-dev patak-dev added this to the 3.2 milestone Sep 9, 2022
@patak-dev
Copy link
Member

@poyoho we decided to move forward with this feature in today's meeting 👍🏼
Would you rebase the PR once you have a chance? Let's merge it in 3.2

@patak-dev patak-dev merged commit 0cb01ca into vitejs:main Sep 23, 2022
@poyoho poyoho deleted the fix/glob-import-worker branch September 23, 2022 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants