I've been working on creating an NPM package in TypeScript for educational purposes. I have set up my parcel configuration to export both an ESM build and a CJS build. After publishing it on npm, I have successfully installed and used it in both ESM-module environment and cjs environment like:
const dsa = require('awesome-dsa');
//or
const {SinglyLinkedList} = require('awesome-dsa');
or,
import dsa from 'awesome-dsa';
//or
import {SinglyLinkedList} from 'awesome-dsa';
However, I am facing confusion on how to include this package with JSDelivr.
I have tried including both:
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ea8b9d8f9985878fc78e998baadac4dac4df">[email protected]</a>/dist/esm/index.min.js"></script>
and
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fb9a8c9e8894969ed69f889abbcbd5cbd5ca">[email protected]</a>/dist/cjs/index.min.js"></script>
Both of these files exist but I'm encountering errors in the console.
What should be my next steps?