+root
Vike's +root setting is just an alias for Vite's root setting — the project root directory.
It can be absolute, or relative to the current working directory.
You can set it over Vike's CLI:
$ vike dev --root srcOr over the VIKE_CONFIG environment variable:
$ VIKE_CONFIG="{root:'src'}" vike devBoth are equivalent to setting Vite's root setting:
// vite.config.js
export default {
root: 'src'
}// vite.config.ts
import type { UserConfig } from 'vite'
export default {
root: 'src'
} satisfies UserConfigUnlike most Vike settings,
+rootcan't be defined inside a+config.jsfile (Vike emits a warning if you try): Vike needs to know the root directory before it can find your+config.jsfiles. Set it over the CLI, theVIKE_CONFIGenvironment variable,vite.config.js, or Vike's API instead.