Suppose I have a UMD module like this (stored in 'js / mymodule.js'):
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (factory((global.mymodule = global.mymodule || {}))); }(this, function (exports) { 'use strict'; function myFunction() { console.log('hello world'); } }));
How can I use this module in an HTML file like this? (without requirejs, commonjs, systemjs, etc.)
<!doctype html> <html> <head> <title>Using MyModule</title> <script src="js/mymodule.js"></script> </head> <body> <script> </script> </body> </html>
Thanks so much for any help.
javascript html requirejs commonjs systemjs
Dorival
source share