extends

To install Vike extensions you use extends:

// /pages/+config.js
 
import vikeReact from 'vike-react/config'
 
export default {
  // Install vike-react. (Technically: inherit the configuration `vike-react/config`.)
  extends: vikeReact
}

Inheritance

Note that config inheritance also applies to extends.

For example, you can use two completely different rendering strategy: some pages can use Vue without SSR while other pages can use React with SSR.

// /pages/admin/+config.js
 
import vikeVue from 'vike-vue/config'
 
// Applies only to Admin Panel pages:
//   /pages/admin/income/+Page.js
//   /pages/admin/kpi/+Page.js
//   ...
 
// Make all Admin Panel pages use Vue without SSR:
export default {
  ssr: false,
  extends: [vikeVue]
}
// /pages/product/@id/+config.js
 
import vikeReact from 'vike-react/config'
 
// Applies only to the product page:
//   /pages/product/@id/+Page.js
 
// Make the product page use React with SSR:
export default {
  ssr: true,
  extends: [vikeReact]
}