For some reason, it seems like you can't include ESM modules from file://, it's only usable over http://, due to content security policy and CORS stuff...

What could <script type="module" src="script.js"> possibly do that <script src="script.js"> can't do? Why is type="module" so much more dangerous???

This is preventing me from just throwing together small prototype scripts with an interactive component, I don't wanna deal with web servers

#web #javascript #html #html5 #webdev #programming

Like you used to be able to just write an HTML file and a JavaScript file and make a pretty decent little local prototype tool. When you needed libraries you just put a .min.js file in a vendor folder and included it with a script tag (or included it from a CDN if you were lazy).

These days, you can't do that. Not if the library you need follows the standard EcmaScript Module standard instead of the old school "throw a name in the global namespace" approach.

I hate it