I have a small static project written in ES6. It's compiled with Traceur dynamically every reload (for development purposes):
<script src="lib/traceur/traceur.js" type="text/javascript"></script>
<script src="lib/traceur/bootstrap.js" type="text/javascript"></script>
<script>
traceur.options.experimental = true;
traceur.options.sourceMaps = true;
</script>
<!-- my ES6 code goes here -->
<script type="module" src="main.js"></script>
The contents of bootstrap.js
are rather simple:
new traceur.WebPageTranscoder(document.location.href).run();
Now, I can't get the source maps to work (Chrome 34). The manual suggests the file should be compiled offline and served with appropriate header, but that's precisely what I was trying to avoid.
Is there a way to get source maps to work entirely from the client side?
They are particularly useful for you and your team because they help tremendously for debugging issues as well as day-to-day work. I'm sure I make use of them just about every day. I'd say in general, they are used for local development.
Haven't used it personally but https://www.npmjs.org/package/es6-module-loader looks like it might be what your looking for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With