-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Asset Manager can't load .esm Modules #3783
Comments
Can you provide an example of the twig you are using and what you expect the output to be? |
yes, sure - in twig, I can load the desired esm Modules like so: ` <script type="module"> import PhotoSwipeLightbox from 'https://unpkg.com/[email protected]/dist/photoswipe-lightbox.esm.js'; import PhotoSwipe from 'https://unpkg.com/[email protected]/dist/photoswipe.esm.js'; import PhotoSwipeSlideshow from 'https://cdn.jsdelivr.net/gh/htmltiger/photoswipe-slideshow/photoswipe-slideshow.esm.min.js'; const lightbox = new PhotoSwipeLightbox({ gallery: '#photoswipe-gallery-id', pswpModule: PhotoSwipe, children: 'a'}); const slideshowPlugin = new PhotoSwipeSlideshow(lightbox,6); // statt 4 sec lightbox.init(); </script>` ` sprintf('import PhotoSwipe from "https://unpkg.com/[email protected]/dist/photoswipe.esm.js";'), sprintf('import PhotoSwipeSlideshow from "https://cdn.jsdelivr.net/gh/htmltiger/photoswipe-slideshow/photoswipe-slideshow.esm.min.js";'), sprintf('const lightbox = new PhotoSwipeLightbox({ gallery: "#photoswipe-gallery-id", pswpModule: PhotoSwipe, children: "a"});'), sprintf('const slideshowPlugin = new PhotoSwipeSlideshow(lightbox,6);'), sprintf('lightbox.init();'), ` I also tried to add the modules via |
I just stumbled over a Problem with Javascript esm Module loading via Asset Manager as described in the docs - it turned out that it looks like being impossible to do this.
my example was photoswipe slideshow, which is only provided as an esm Module.
I tried with several Options (loading...) but none worked.
So, I guess, this is a feature request.
The text was updated successfully, but these errors were encountered: