From 63a5056962d29b0b3fe10c0b4a740ad94dabb08f Mon Sep 17 00:00:00 2001 From: Will Eastcott Date: Thu, 12 Dec 2024 19:31:53 +0000 Subject: [PATCH] Update README.md --- README.md | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e4e5e06..9459a00 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,8 @@ See PlayCanvas Web Components in action here: https://playcanvas.github.io/web-c ## Usage 🚧 +### Installing from NPM + PlayCanvas Web Components is available as a package on [NPM](https://www.npmjs.com/package/@playcanvas/web-components). You can install it (and the PlayCanvas Engine) as follows: @@ -39,13 +41,39 @@ You can install it (and the PlayCanvas Engine) as follows: npm install playcanvas @playcanvas/web-components --save-dev ``` -You can then use a bundler (such as Webpack or Rollup) to build your application. Or you can import the components as follows: +Next, in your HTML file, you will need an import map because the web components need to be able to find the PlayCanvas Engine (which is an external dependency): + +```html + +``` + +Tou can then import the components as follows: ```html ``` -Instead of loading the library from a local package, you can instead opt to load it from a CDN. +### Using a CDN + +Instead of loading the library from a local package, you can instead opt to load it from a CDN (such as jsDelivr). In this case, you would update the import map: + +```html + +``` + +And the components would now be imported as follows: ```html