Before you submit:
The problem
I wish to include Luminous onto my page my just embedding a <script> tag linking to UnPkg or jsDelivr CDN.
But getting this error:
Uncaught ReferenceError: exports is not defined
at lum.js:3:23
This can be bypassed by:
- Compiling the module into another JS file, hosting it somewhere and linking on it. You use this way on your CodePen demo. But I can not be sure how long will be alive the compiled file you hosted:
https://s3-us-west-2.amazonaws.com/s.cdpn.io/164071/Luminous.min.js
- or a developer can create some external script and import there Luminous like in module:
import {LuminousGallery} from "https://unpkg.com/luminous-lightbox";
but this requires this new script to be included into HTML with type="module" attribute.
All these two ways are significantly more complicated than just including a snippet.
Suggested solution
Please consider adopting the package on NPM to be compliant with including as a snippet.
All JS libraries nowadays offer such an opportunity, I wish Luminous could also do.
Before you submit:
The problem
I wish to include Luminous onto my page my just embedding a <script> tag linking to UnPkg or jsDelivr CDN.
But getting this error:
This can be bypassed by:
https://s3-us-west-2.amazonaws.com/s.cdpn.io/164071/Luminous.min.jsimport {LuminousGallery} from "https://unpkg.com/luminous-lightbox";but this requires this new script to be included into HTML with
type="module"attribute.All these two ways are significantly more complicated than just including a snippet.
Suggested solution
Please consider adopting the package on NPM to be compliant with including as a snippet.
All JS libraries nowadays offer such an opportunity, I wish Luminous could also do.