i-VRESSE / haddock3-analysis-components

Components to be used by analyse command of haddock3
Apache License 2.0
0 stars 0 forks source link

Bundle Mode in ESM CDN and importmaps #7

Closed SarahAlidoost closed 12 months ago

SarahAlidoost commented 12 months ago

ESM CDN has a Bundle Mode to put all dependencies into a single JS file, see doc. We use the ?bundle in example.local.html when importing ngl in order to fix the error Uncaught (in promise) TypeError: tp.scale is not a function. When using bundle mode, ngl.bundle.mjs file is created under esm.sh, see image

However, this solution does not work for example.html and ngl.bundle.mjs file is NOT created. Instead when ?bundle is added to haddock3-analysis-components i.e. "https://esm.sh/@i-vresse/haddock3-analysis-components?bundle", the example works.