schmod / babel-plugin-angularjs-annotate

Add Angular 1.x dependency injection annotations to ES6 code
http://schmod.github.io/babel-plugin-angularjs-annotate
MIT License
241 stars 26 forks source link

Remove prologue string? #38

Closed bhollis closed 6 years ago

bhollis commented 6 years ago

I use the 'ngInject' prologue string everywhere, and angularjs-annotate does a wonderful job with it. But once the transform has happened, do we still need that prologue? We could save a bit of space in the final bundle by removing it.

schmod commented 6 years ago

Seems like a perfectly reasonable addition, given that a good minifier probably shouldn't be removing those prologue strings (which was my original assumption when I built this). I don't have a ton of time to work on this project lately, but would be happy to look over a PR, or might be able to adding it myself once I find some free time...

My only requirement is that code should be able to be run through this plugin and a minifier multiple times without any negative effects. Ideally, I want developers to be able to safely run this plugin against any Angular 1.x codebase, particularly 3rd-party libraries, without having to think about whether the original sources have already been transpiled or minified.