This guide is for when you want to ensure that a Quasar Plugin will be injected into the hosting app, because you depend on it for your own App Extension to work.
We will only need to touch the Index script for this, because we can use the Index API to configure the /quasar.config file from the host app to include our required Quasar Plugin.
import { defineIndexScript } from '@quasar/app-vite'
export default defineIndexScript((api) => {
// ...
// Here we extend /quasar.config file, so we can add
// a boot file which registers our new Vue directive;
// "extendConf" will be defined below (keep reading the tutorial)
api.extendQuasarConf((conf, api) => {
// Let's play nice and add it only if it's not defined already
if (!conf.framework.plugins.includes('AppVisibility')) {
conf.framework.plugins.push('AppVisibility')
}
})
}content_paste