Quantcast

[MediaWiki-l] Loading Javascript files that use import

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[MediaWiki-l] Loading Javascript files that use import

George, Garrett J. (JSC-CB111)[SGT, INC]
Hey all,

I'm currently trying to implement a third party library into an extension I'm developing and was running into the error unexpected token import when the Javascript will run import X from Y. I believe it wants var X = require(Y) but I don't necessarily want to go through all the import statements and rewrite them. If I use the libraries CDN link and add a <script> tag at the head of the page and it gets executed by the browser (Chrome) the library loads fine. I'm not sure where it originates from, but it seems to have to do with load.php and how it handles javascript files and ResourceLoader.

Thanks,

Garrett
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Loading...