Plugin ordering for Vuetify - merge of user's & iles vite config
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 36
- PR merge metrics
- No merged PRs in 30d
Description
**Is your feature request related to a problem? Please describe.**
When adding vite plugins via our own vite.config.js, there are some challenges when the user's vite config & iles config are merged. Specifically, the ordering of the vite plugins. For eg, when adding vuetify to Iles using `enhanceApp` api, it has to be added after vue plugin (@vitejs/plugin-vue), otherwise vuetify components won't compile correctly.

**Describe the solution you'd like**
May be something like what nuxt does - using custom module to insert plugins in the correct place - `nuxt.hooks.hook('vite:extendConfig')`?
(Or) implement a callback so that we can just .push() or .unshift() to the defaults?
**Describe alternatives you've considered**
I was able to insert the Vuetify plugin at the right spot by using my own custom plugin like below. May be this is how we could ideally do, instead of any other complex way (as suggested above)
```
plugins: [
{
configResolved(config) {
const idx_vue = config.plugins.findIndex(
(plugin) => plugin.name && plugin.name === 'vite:vue'
)
config.plugins.splice(idx_vue + 1, 0, Vuetify()[0])
}
}
],
```
Repo (that works with the custom plugin hack) - https://stackblitz.com/github/TechAkayy/my-iles-vuetify-app?file=vite.config.js
**Additional context**
Supporting vite plugins that enable usage of UI components library like vuetify is a great and must outcome that will tremendously boost Iles adoption across the large vue ecosystem as intented. Making this work could also open-up new avenues where vuetify-based custom theme-authoring for Iles could evolve. Thanks in advance!
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.