btford / ngmin

**deprecated** AngularJS Pre-minifier –> use ng-annotate –>
https://github.com/olov/ng-annotate
860 stars 42 forks source link

Fixes #19 - Add support for source-map generation #51

Closed caitp closed 10 years ago

caitp commented 11 years ago

The generated sourcemap is not very helpful as of yet, but I'm working on that. I think this is probably a better solution than the alternative method attempted earlier :)

The astral-angular-annotate module will need to be updated to update the locations of items, I think. But it's sort of difficult to work out how it's intended to actually work.

I don't know how this will work with source-map chaining as of yet, that is a more involved test, I'll do more of that once it's a bit further along I suppose.

caitp commented 11 years ago

So, this -sort of- works, in my tests... But I think the line numbering is all screwy still, I'm not totally sure how hard it will be to fix that. The mappings are not really "accurate". :(

I'll probably need to study other implementations, such as those in coffee-script, to figure out how to do this better.

olanod commented 11 years ago

+1, check UglifyJs2 which allows specifying an input .map file. It would be cool to have my final source map reference my original coffee files after ngmining and uglifying.

btford commented 10 years ago

Sorry for the late reply on this

I'd love to have sourcemap support, but I'm thinking the best way would be to have an overarching build system that handles it. This is my intention with Astral, but that project has a ways to go.

In the mean time, I'm happy to accept this if/when you get it working. :)

cparker15 commented 10 years ago

Any progress, @caitp? I'm in the same position as @olanod.

Happy to help.

caitp commented 10 years ago

Well the mechanics for it (I think) are pretty much in place, but a remaining piece is to add the source map locations for each generated symbol in astral-angular-annotate, and that would take more time than I really have to put into it at the moment :(

If someone else writes a patch to hack that stuff into the annotate component, it should be pretty much there. The downside to the super-modular structure is that writing a test suite for the changes is a bit tricky, and because of that I'm not super confident in the code I'd write

NickHeiner commented 10 years ago

:+1: This would be super useful for me and my team.

qraynaud commented 10 years ago

Same here !

mgol commented 10 years ago

@qraynaud

Same here !

This module is no longer maintained; see https://github.com/olov/ng-annotate/issues/49 for the source map issue in ng-annotate.