Can i remove plugins from PWA?


#1

Hi everyone. I’ve made a PWA website that’ll mainly be used on desktop. It always throws warnings on plugins that are not usable (like splashscreen, statusBar and Device).
Can i remove then? There’ll be no errors after this since they’re plugins that comes with the project? If by some reason my client decides to use the app on his phone browser there’ll be problems because of the lack of this plugins?

Thanks


#2

You can do something like:

import { Platform } from 'ionic-angular';

@Component({...})
export MyPage {
  constructor(public plt: Platform) {
    if (this.plt.is('cordova')) {
      // use cordova plugin here
    }
  }
}

See https://ionicframework.com/docs/api/platform/Platform/.

But if your app will only ever be used in a browser (desktop or mobile browser) and not be released as a Android/iOS app, I think you could also completely remove the cordova plugins.


#3

It’ll not be released on iOS/Android, so i think i’ll go with removing them, if something strange happens then i’ll use your solution of checking platform.
Thanks