Getting started : JSPM
- Install jspm globally (or locally, if so run
npx jspm
instead ofjspm
):
npm install -g jspm
- Create a directory, install npm dependencies (es-module-shims is an importmap polyfill that jspm includes by default):
mkdir imtest
cd imtest
npm install es-module-shims @atcute/oauth-browser-client
- Create index.html with a script that imports stuff (JSPM also supports scripts in external files):
$ cat > index.html
<!doctype html>
<script type="module">
import { configureOAuth } from '@atcute/oauth-browser-client';
console.log(configureOAuth );
</script>
- Finally, resolve the importmap and update index.html:
jspm link --provider nodemodules index.html -o index.html