Using Capacitor in a Web Project
Capacitor fully supports traditional web and Progressive Web Apps. In fact, using Capacitor makes it easy to ship a PWA version of your iOS and Android app store apps with minimal work.
Plugins with web support will perform feature detection and throw exceptions if a browser does not support a particular Web API.
If you're already building with Capacitor for iOS or Android, there are no additional installation steps!
Otherwise, see the Installation guide before continuing.
Using Capacitor as a Module
Using Capacitor as a Script Include
To use the Capacitor runtime in a web app that is not using a build system or bundler/module loader, do the following:
truein the Capacitor configuration file
- Copy the Capacitor runtime bundle (
capacitor.js) into your web assets directory
npx cap sync web
When you're ready to publish your Progressive Web App and share it with the world, just upload the contents of your web assets directory.
That will contain everything you need to run your app!