• Stars
    star
    120
  • Rank 295,983 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 10 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Webpack loader to annotate angular applications

ng-annotate-loader Build Status

Webpack loader to annotate angular applications. Generates a sourcemaps as well.

Installation

npm install --save-dev ng-annotate-loader

Usage:

module: {
  loaders: [
    {
      test: /src.*\.js$/,
      use: [{ loader: 'ng-annotate-loader' }],
    }
  ]
}

Passing parameters:

{
  test: /src.*\.js$/,
  use: [
    {
      loader: 'ng-annotate-loader',
      options: {
        add: false,
        map: false,
      }
    }
  ]
}

More about ng-annotate parameters

Using ng-annotate plugins:

{
  test: /src.*\.js$/,
  use: [
    {
      loader: 'ng-annotate-loader',
      options: {
        plugin: ['ng-annotate-adf-plugin']
      }
    }
  ]
}

Using a fork of ng-annotate:

{
  test: /src.*\.js$/,
  use: [
    {
      loader: 'ng-annotate-loader',
      options: {
        ngAnnotate: 'my-ng-annotate-fork'
      }
    }
  ]
}

Works great with js compilers, babel for example:

{
  test: /src.*\.js$/,
  use: [
    { loader: 'ng-annotate-loader' },
    { loader: 'babel-loader' },
  ]
},

Contributing

Compiling examples and run acceptance test

Run on the root folder:

npm install
npm test

Using loaders