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: worker config call config hook #9212

Merged
merged 6 commits into from Jul 19, 2022
Merged

Conversation

poyoho
Copy link
Member

@poyoho poyoho commented Jul 19, 2022

Description

fix: #9205

Additional context

call worker config hooks.


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.

const resolvedWorkerOptions: ResolveWorkerOptions = {
format: workerConfig.worker?.format || 'iife',
plugins: [],
rollupOptions: workerConfig.worker?.rollupOptions || {}
}
Copy link
Member Author

@poyoho poyoho Jul 19, 2022

Choose a reason for hiding this comment

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

NOTE: the raw userPlugin can not modify the config.worker.

user config config and worker resolved config use the same resolvedWorkerOptions what config by vite.config.js and modify by worker plugin.

@patak-dev
Copy link
Member

patak-dev commented Jul 19, 2022

Thanks a lot @poyoho, looks good!

@patak-dev patak-dev merged commit 3e510ab into vitejs:main Jul 19, 2022
12 checks passed
@poyoho poyoho deleted the fix/worker-config branch Jul 19, 2022
This was referenced Jul 21, 2022
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.

worker.rollupOptions is ignored if set in a plugin
2 participants