You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Exploring ES6
I have a use case where an external program produces an html file that has css and javascript in it. The page shows a diagram of a computer network using various data files as its input.
I'd like to use modules (eventually) but the way things are phrased I'm afraid I won't be able to. Your books says that there is one module per file and one file per module.
In my case, the output file is self contained and does not refer to any external entities. This is so the html file can be moved around and it still works. This means that the javascript code pieces are within script tags without a src attribute. Is there a method to make these modules and leverage the beauty of import and export?
In other words, is there a way to attach a "file" (or a file name) to the javascript code embedded within a script tag? For example when I say "import from 'module1';" module1 isn't somewhere out on the net but is within the html file already.
This may be more of a browser implementation question than a javascript question but I thought I would ask here first hoping this use case has already been discussed at some point.