-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove "ngInject" prologues after adding annotations #220
Comments
The intent is to alter the source code minimally. Keeping the |
I would definitely find such an option useful. I appreciate the intent behind only making the minimal changes to the code as necessary, but I think an opt-in flag for removing the "ngInject" prologues would be a great addition. |
Same here. I think a one-way workflow should be considered a non-negligible, maybe typical, use-case. |
if you are using gulp or another build system you could also use replace to remove the prologue stuff //...
.pipe(concat('app.js'))
.pipe(annotate({ single_quotes: true, remove: true, add: true }))
.pipe(replace(/\t'ngInject';\n/g, ''))
.pipe(uglify())
//... |
Just for the record, here's my working Webpack loader setup: // loaders are executed in reverse order
const loaders = [
'string-replace?search=\'ngInject\';&replace=',
'ng-annotate',
'nginject?deprecate',
'babel'
]; This babelifies, then checks for any deprecated |
From readme:
Why doesn't ng-annotate do this itself? Is there some conceptual reason, or is a PR welcome?
The text was updated successfully, but these errors were encountered: