Skip to content
Discussion options

You must be logged in to vote

OK, here's a working example in one HTML file. You can open this on the file system or via npx cap serve (local web server).

The docs here are most of the way there - I will update soon but in the meantime, here's a WIP full example (subject to change!)

You must include the capacitor.js file locally. It can be found under node_modules/@capacitor/core/dist/capacitor.js or will get copied into your project automatically from there by running the npx cap copy web command (as the docs mention).

<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
  <meta charset="UTF-8">
  <title>Capacitor: Vanilla JS</title>
  <meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=…

Replies: 5 comments 8 replies

Comment options

You must be logged in to vote
4 replies
@mark-divitt
Comment options

@dotNetkow
Comment options

@mark-divitt
Comment options

@dotNetkow
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@mark-divitt
Comment options

@dotNetkow
Comment options

@macsupport
Comment options

@alanxp
Comment options

Answer selected by dotNetkow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants