Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Add sourcemap generation #14

Open
nicolasgarnier opened this issue Aug 24, 2015 · 9 comments
Open

Add sourcemap generation #14

nicolasgarnier opened this issue Aug 24, 2015 · 9 comments

Comments

@nicolasgarnier
Copy link

It would be great to add support for sourcemaps generation.

@ebidel
Copy link
Contributor

ebidel commented Aug 24, 2015

@azakus this would help for the ES6 stuff we're doing for the Summit. WDYT?

@dfreedm
Copy link
Contributor

dfreedm commented Aug 24, 2015

Hmm, adding sourcemaps to crisper can't quite work if you use vulcanize, because any inlined scripts will lose their original file locations.

At best I could use source-map-concat to keep any existing sourcemaps.

@nicolasgarnier
Copy link
Author

I think at this point we just need Crisper to output the sourcemaps for the transformation it's doing.

Concatenating the sourcemaps when processing a file with multiple tools (e.g. with Vulcanize) is up to the developer or the build pipeline. For instance in gulp when using gulp-sourcemaps the concatenation is done automatically as long as the tool (and plugin) supports outputing a sourcemap.

I'm just saying: You don't have to care about concatenation of sourcemaps :) Simply output the sourcemap for the transform that Crisper does. Developers already have tools/build processes to take care of piping multiple tools that outputs sourcemaps.

Also there are other use for Crisper than using it after Vulcanize. For instance it's also useful with Babel (for ES6 transpilation). In one of the codelabs we're building we'll do:

  1. Extract JS from HTML files using Crisper
  2. Transpile the JS files from ES6 to ES5 using Babel

We need to do this because Babel does't support transpiling JS that's inline HTML directly. But then unfortunately when doing this we're loosing sourcemaps support because of Crisper.

@dfreedm
Copy link
Contributor

dfreedm commented Aug 24, 2015

What do you expect the sourcemaps of formerly inline scripts to point to? The HTML file the file was in, or an embedded copy of the original source lines?

@nicolasgarnier
Copy link
Author

Quite often the tools have the 2 options. For instance Traceur has the following option: --source-maps [file|inline] (embedded or as a separate file). But if that's too much work I personally prefer a separate file :) That's usually what's used in prod anyways because inline makes the file huge and most website visitors don't need to sourcemap.

@indolering
Copy link

+1 tracking bugs in production is a PITA without sourcemaps.

@ronnyroeller
Copy link

+1

1 similar comment
@tylerthehaas
Copy link

+1

@chajath
Copy link

chajath commented Oct 19, 2017

Any progress in this item? To many web devs, a framework that doesn't allow source mapping to the origin is an absolute no-fly zone

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants