Check out the web/pwa details here for using Capacitor without a build system.
statusbar.js, and include it in my index.html thusly:
<script type="module" src="/js/statusbar.js"></script>
That causes an error because of the import statement:
(index):1 Uncaught TypeError: Failed to resolve module specifier "@capacitor/core". Relative references must start with either "/", "./", or "../".
I understand that relative imports are re-written by webpack, but I’m not using that. Is there an easy way to convert that to something that resolves correctly?
If you don’t want to use a bundler/framework, you can set
"bundledWebRuntime": true in
capacitor.config.json . That generates a
capacitor.js file you can link in your app’s
That way you can use
Capacitor object directly, which includes a
Plugins object that contains all plugins.
So you can use the plugins like
Thank you. This was just what I needed!
How could one add capacitor plugins this way (using Capacitor object directly) in version 3 , since they are not included in capacitor.js?