We can use following syntax to run the target module's global code without importing anything:
import "<module-name>"
console.log("loading lib"); export function showSum(x, y) { show(x + y); } function show(result) { console.log(result); }
import "./lib.js"; console.log("app running"); showSum(3, 5);//error because it is not imported
<html> <script type="module" src="./js/app.js"></script> <body> </body> </html>
To try examples, run http-server from project root:
$ http-server
On loading index.html, following is printed in console:
Dependencies and Technologies Used: