// external.html
<script type="module">
import main from './main.js';
main();
</script>
// main.js
import createWebSocketYouKnow from '/websocket';
const ws = createWebSocketYouKnow();
In this repo, we've mostly been using the script tag approach but I think going forward we should be using ES modules like we're doing in the more recent (private) apps. #96 tracks updating all the code.
Following from the discussion in #95, here's the implementation with ES being the primary export for the browser.
node.js
script
tagES Module
The above would also be usable within a module:
In this repo, we've mostly been using the
script
tag approach but I think going forward we should be using ES modules like we're doing in the more recent (private) apps. #96 tracks updating all the code.