I am using a --experimental-loader
in node.js for a .mjs file. The command looks something like this:
node --experimental-loader=./loader.mjs ./demo.mjs
I wish to use the loader in the browser that supports import statement inside a ES script module <script type="module"></script>
. The loader basically has a small modification.
<script type="module">
<!-- Need a loader to load before this like node.js -->
import { default as x } from "./bundle.js";
</script>