vuetifyjs / nuxt-module

Zero-config Nuxt Module for Vuetify
https://nuxt.vuetifyjs.com/
MIT License
226 stars 22 forks source link

vuetify.config.ts inherits defaults incorrectly if there are multiple layers #231

Closed lna1989 closed 4 months ago

lna1989 commented 5 months ago

Example: https://stackblitz.com/edit/nuxt-starter-iknbls?file=pages%2Findex.vue

There is a Nuxt.js project that inherits from the "first" layer. In turn, the "first" layer inherits from the "second" layer.

I assume the following behavior when working with default configuration values - it is initially filled with the value from the "second" layer and is redefined by the keys of the first "first" layer and the final instance of the "project" as it is done now in nuxt.config.ts, and there is the functionality of a complete redefinition of the object through the callback function.

Now, basically, the override works correctly with the "second" layer and "project", but the intermediate layers are ignored, like the "first" layer from the example.

userquin commented 4 months ago

@lna1989 We should use unshift instead push here , defu should be called in reverse order since the second parameter are the defaults.

imagen

lna1989 commented 4 months ago

@userquin Yes, it works correctly, thank you so much for your work!