Use Vite's Environment APIs
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 10.5k
- Forks
- 564
- PR merge metrics
- No merged PRs in 30d
Description
Feature Request
Instead of orchastrating all of the individual vite builds manually, let Vite do it using it's Environment API: https://vite.dev/guide/api-environment-frameworks
- Here's the basic structure for production builds to work: https://github.com/wxt-dev/wxt/issues/1046#issuecomment-5109933695
- I have not tested dev mode yet - that will be apart of this issue.
Is your feature request related to a bug?
Follow up to #1046
What are the alternatives?
Keep manually building each of the entrypoints
Additional context
- I'm not sure if vite re-uses caches or intermediate values between environments. If it does, this will speed up builds, if not, it would be the same. Depending on if there is less code, we may or may not keep it in that case.
- This was not possible to adopt until we dropped support for vite versions before v6, which we did in v0.21
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Vite's Environment API documentation and the production-build structure linked in issue #1046. Investigate how the current entry points are built, then determine how dev mode behaves; done means production and development builds use the Environment API instead of manually orchestrated individual builds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100