JSPM

@everymatrix/ng-annotate-webpack-plugin-patched

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 19
  • Score
    100M100P100Q55231F
  • License MIT

webpack plugin that runs ng-annotate-patched on your bundles

Package Exports

  • @everymatrix/ng-annotate-webpack-plugin-patched
  • @everymatrix/ng-annotate-webpack-plugin-patched/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@everymatrix/ng-annotate-webpack-plugin-patched) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ng-annotate-webpack-plugin

ng-annotate is deprecated. Consider using https://github.com/schmod/babel-plugin-angularjs-annotate instead.


WebPack plugin that runs ng-annotate on your bundles

Based on ng-annotate-webpack-plugin Old version no longer works with webpack 4 because ngAnnotate, which this package is based on, is no longer maintained. This fork is replacing the old ngAnnotate used in the plugin with a patched version of ngAnnotate which works with newer es2015 code syntax

Usage

In webpack.config.js:

var webpack = require('webpack');
var ngAnnotatePlugin = require('ng-annotate-webpack-plugin-patched');

module.exports = {
    /// ... rest of config
    plugins: [
        new ngAnnotatePlugin()
    ]
}

To modify the default plugin options or to add options for ng-annotate:

var webpack = require('webpack');
var ngAnnotatePlugin = require('ng-annotate-webpack-plugin-patched');

module.exports = {
    /// ... rest of config
    plugins: [
        new ngAnnotatePlugin({
            add: true,
            // other ng-annotate options here
        })
    ]
}

Since version 0.4.0: for performance reasons, chunks where the name starts with vendors~ are not annotated. To customize this behavior, set the option annotateChunk to a method that returns true if a chunk should be annotated:

var webpack = require('webpack');
var ngAnnotatePlugin = require('ng-annotate-webpack-plugin-patched');

module.exports = {
    /// ... rest of config
    plugins: [
        new ngAnnotatePlugin({
            add: true,
            annotateChunk: (chunk) => !chunk.name || !chunk.name.startsWith("vendors~"),
            // other ng-annotate options here
        })
    ]
}

If you are looking for a loader instead of a plugin, use ng-annotate-loader instead