Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use source maps with Traceur used directly from the page?

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?

like image 811
Bartek Banachewicz Avatar asked Apr 29 '14 13:04

Bartek Banachewicz


People also ask

Should I use Sourcemaps production?

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.


1 Answers

Haven't used it personally but https://www.npmjs.org/package/es6-module-loader looks like it might be what your looking for.

like image 62
Ethan Lynn Avatar answered Oct 16 '22 10:10

Ethan Lynn