You can use config inheritance to have multiple and completely different stacks within the same app.
For example:
While it's in principle possible, there is currently a blocker for being able to use vike-vue and vike-react within the same app.
vike-telefunc doesn't exist yet: it's the upcoming integration that will enable you to use RPC for fetching initial data (instead of using +data).
Pointer imports
Internally, Vike transforms this:
Into:
This enables Vike to load the file /pages/+config.js without having to load LayoutDefault.jsx. This means that Vike can quickly load all your +config.js files without having to load any runtime code.
These fake imports, which we call pointer imports, apply only to +config.js files. Imports in other + files are normal imports.
It's similar to when you import images:
Vike transforms an import inside +config.js to be a pointer import if and only if the import resolves to a file that doesn't end with .js/.ts/.mjs/.mts/.cjs/.cts.
For example, an import that resolves to a .jsx or .vue file is transformed to be a pointer import:
A .jsx or .vue file is meant to be client-/server-side runtime code (it isn't used for defining configuration logic). It therefore makes sense to treat .jsx and .vue imports as pointer imports.
Config code isn't runtime code
The config code itself is never included in runtimes:
Forbidden runtime code
If you get this error:
Then this means you're trying to define runtime code inside a +config.js file which is forbidden.
The title() function is called at runtime (when the page is rendered) and not at config time (when Vike loads +config.js files).
Instead do this:
Or this:
Manually mark pointer imports
You can manually mark an import to be a pointer import:
🚧
The with { type: 'pointer' } import attribute isn't implement yet, see workaround at #1500.