componentjs / builder2.js

builder for component
50 stars 20 forks source link

full source map support #26

Open jonathanong opened 10 years ago

jonathanong commented 10 years ago

i.e. without the sourceURL crap that barely even works. each file should have a file.map() method or something that you can pass a source map into. then the builder will handle the source mapping itself. maybe file.map(false) to denote that there is no source map, i.e. regenerator

frankwallis commented 10 years ago

There may be an easier way to do this which is to use vinyl-sourcemaps-apply (similar approach to gulp-sourcemaps).

So it becomes the responsibility of each transform which changes the name and structure of a file to register the source map with vinyl-sourcemaps-apply.

component-builder would need to generate a source map for its concatenation step

component-build could do the vinyl-sourcemaps-apply.init() and vinyl-sourcemaps-apply.write() and vinyl will take care of merging all the source maps into a single one. When using gulp-component-build it would all work as normal with gulp-sourcemaps.

I had a look at how I could implement this in component-builder but it looks like quite a big change - interested to know you thoughts?

thanks