6

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?

Bartek Banachewicz
  • 38,596
  • 7
  • 91
  • 135

2 Answers2

1

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

Ethan Lynn
  • 1,009
  • 6
  • 13
0

Try

traceur.options.sourceMaps = 'inline';

https://github.com/google/traceur-compiler/wiki/SourceMaps