electerious / basicLightbox

The lightest lightbox ever made.

Home Page:https://basiclightbox.electerious.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't import from minified source

funkyfuture opened this issue · comments

in my javascript file i import basicLightbox with import * as basicLightbox from './basicLightbox.js';, however when i have the minified version in place there, i get an Uncaught TypeError: basicLightbox.create is not a function where i call basicLightbox.create. with the plain source it works just fine.

Can you do a simple console.log(basicLightbox)? Would be interesting to see what it contains.

Are you minifying your code afterwards? Maybe the error occurs because of the double-minification (it shouldn't, but it's possible). Can you try it with your minification turned off?

i use the dist.basicLightbox.min.js and the log says Symbol(Symbol.toStringTag): "Module".

This isn't saying me anything, but it could be because you're rebundling everything and the minified version is already bundled. I would recommend to stay with unminified source. Let me know if you find out more.

because you're rebundling everything

no, i'm still too fresh and incompetent in Javascript to figure out how to do this. might the error evoke because i have type="module" specified in the embedding script tag?

Could be, but I haven't used type="module", yet. I will keep the issue open, but can't provide a solution. Maybe someone else has the same issue and hopefully knows what's going on.

Closing this issue because I can't provide a solution.