A ng-annotate plugin for brunch.
DEPRECATED: ng-annotate, which this project depends on, is now deprecated. You are advised to use babel-plugin-angularjs-annotate instead.
Two ng-annotate plugins for brunch already exist: ng-annotate-brunch and ng-annotate-uglify-js-brunch.
The two existing solutions did not fit
my use case because they place the annotating process inside the optimize phase of brunch. This means that
annotations were not present in the development build, only in the production build. I want the annotations to be there
in dev so I can have ng-strict-di
enabled and that will check if the annotations are really all there.
Turns out you can use the plugins.on
option in the brunch config to force optimize plugins to run.
- You might not need or want to minify at the same stage as annotating so ng-annotate-uglify-js-brunch is out.
- ng-annotate-brunch does not have source maps support.
- ng-annotate-brunch does not support an ignore option, which can give a significant speed boost.
npm install inject-this-brunch
plugins: {
ngAnnotate: {
// place config here
}
}
The plugin configuration is passed to ng-annotate.
By default, the following options are passed: {add: true, remove: true, map: {inFile: <path of input file>}}
, i.e.
annotations are rebuilt and source maps are generated.
When a configuration is provided in brunch-config.js
:
add
andremove
default totrue
unless they are explicitly set to falsy values.map.inFile
is automatically provided unlessmap
is explicitly set to a falsy value.
Default: /\.js$/
Default: /^(bower_components|vendor)/