-
-
Notifications
You must be signed in to change notification settings - Fork 349
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
Config inheritance seems to be in reverse order from docs #1458
Comments
Let me try to reproduce.
Sure, we can always close it anyways if there is a better solution :) |
Indeed, I could reproduce and your fix was correct. Fix pre-released as Also, in case your company is up for it: Support Vike #1350. |
Hey thanks for the quick response. I wasn't sure what sort of sort guarantees I don't have an employer at the moment, but I respect the hustle! Just sent you some beer money. Thanks for Vike! |
Thank you 🍻 |
Description
Hello! https://vike.dev/config#overridable-defaults says "The +config.h.js file of pages (/pages/some-page/+config.h.js) can override default values defined by /pages/+config.h.js.", but it didn't seem to be working that way (playing around with defining Page meta to manually control render modes). Debugging the issue it seems like the sort order in the implementation is to have longer path lengths first, so when they are iterated over, shorter paths clobber config set by more specific ones.
vike/vike/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.ts
Line 809 in d90bba5
I'm on version 0.4.156. Can you confirm you are seeing this as well? A simple repro is to define
meta: { Page: { env: { server: true, client: false } }
inpages/
orrender/
config and then override withmeta: { Page: { env: { server: true, client: true } }
in a specific path and check for the client side bundle on load.If I change the above line to the following then it works as expected:
Happy to PR this as well 😄
The text was updated successfully, but these errors were encountered: