Convert Vite plugin adapter API to presets - #8620
Conversation
🦋 Changeset detectedLatest commit: 08ebfc2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
adapter API to presets
| ...(mergeRequired("presets") | ||
| ? { | ||
| presets: [...(configA.presets ?? []), ...(configB.presets ?? [])], | ||
| } | ||
| : {}), |
There was a problem hiding this comment.
I don't think we want to support merging presets. Presets should all be declared upfront. That could also simplify updateRemixPluginContext where omit is called for presets key.
There was a problem hiding this comment.
This code is currently not used since we never attempt to merge two configs that both have presets. Currently only user configs can have them. I only included it here for completeness in case this function ever ends up being public API.
|
🤖 Hello there, We just published version Thanks! |
|
🤖 Hello there, We just published version Thanks! |
This PR makes the following changes:
adapterAPI into a more generalpresetsAPI, supporting an array of preset objects that can define config to be merged with defaults before the user config is applied at the end.loadContextandviteConfigoptions from the oldadapterAPI.remixConfigResolvedhook to the preset which provides support for config validation after all presets have been applied.nameproperty to presets so that we can roll out improved error messaging support to the newremixConfigResolvedhook in the future.buildEndoption available as a top-level option, not just for adapters.Note that the documentation for preset authors is pretty light right now while this feature is still fresh. I'll add more docs as a follow-up, but the priority is to get this out for now.