spa + capacitor || dynamic import capacitor plugins
-
Please tell me how to import plugins for the capacitor, if everything crashes when launched in SPA mode.
I check for the platform or mod, but still an error comes out, although the import is dynamic.I have this error only in SPA mode, in capacitor all fine.
-
@rabix try
async created () { let apiPush = null if (process.env.MODE === 'capacitor') { apiPush = await import('my-fancy-npm-package') // .then(package => package.default) } }
https://quasar.dev/quasar-cli/handling-process-env#Import-based-on-process.env
-
@metalsadman thanks!!!