Skip to content

Commit c17489f

Browse files
author
Andrey
authored
Merge pull request #40 from bluetech/allow-to-use-fork
Add an option to use a fork of ng-annotate
2 parents 85f020e + d247d3e commit c17489f

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,22 @@ module: {
5656
}
5757
```
5858

59+
#### Using a fork of ng-annotate:
60+
61+
```js
62+
{
63+
test: /src.*\.js$/,
64+
use: [
65+
{
66+
loader: 'ng-annotate-loader',
67+
options: {
68+
ngAnnotate: 'my-ng-annotate-fork'
69+
}
70+
}
71+
]
72+
}
73+
```
74+
5975
#### Works great with js compilers, `babel` for example:
6076

6177
```js

loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
var ngAnnotate = require('ng-annotate');
21
var utils = require('loader-utils');
32
var SourceMapConsumer = require('source-map').SourceMapConsumer;
43
var SourceMapGenerator = require('source-map').SourceMapGenerator;
@@ -73,6 +72,7 @@ module.exports = function(source, inputSourceMap) {
7372
var filename = normalizePath(this.resourcePath);
7473
this.cacheable && this.cacheable();
7574

75+
var ngAnnotate = require((utils.getOptions(this) || {}).ngAnnotate || 'ng-annotate');
7676
var annotateResult = ngAnnotate(source, getOptions.call(this, sourceMapEnabled, filename));
7777

7878
if (annotateResult.errors) {

0 commit comments

Comments
 (0)