{"bin":{"purify":"./src/purify/cli.js","build-optimizer":"./src/build-optimizer/cli.js"},"bugs":{"url":"https://github.com/angular/angular-cli/issues"},"dist":{"shasum":"336404e7716a2e2bb91f40ded669327e814598fc","tarball":"https://registry.npmjs.org/@angular-devkit/build-optimizer/-/build-optimizer-0.8.0-beta.2.tgz","fileCount":36,"integrity":"sha512-VtMKhXC8OQj3l4+YKB1BqEfcjRlwpN7pOlq2tz8zB9FhX2reo9d6/SAoO4T1Gs7SMQaTPJnV+LTANWJCiqBASA==","signatures":[{"sig":"MEUCIHHBWo9mU8i+1hKV9E5WV2t4X0gsPewW99m8EaGqIIRnAiEA4ttgyRDG5AbZfs2ObAJLaNvzbrqT7xnILh8S/yGx0/M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":286792,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbbOqoCRA9TVsSAnZWagAAI8EP/3FRx+FsvK5yKa9FhapK\nCjIkpYsvmzgxS5bMUZsx7Z4EulVBlI093iaWZkErRviLiTUWScHaESqkksCz\nSDh/IkyL4SSyInmScGr4NDx8UrQrSJigjLRtOsw1QMmjcnucnPeV96UyOeGZ\nkngoR4q53VzvZixO87K+yCIIPT98F3JU9h0Rozsb8u/ux52vI4XuyxcjHskv\nK/Ru9IF5K00Q3rLBfTVW4Ed/SPL+chfEdLb88aQWLBkf0K/MXuzDlIrx3IV3\nOZGu3E0m0zwHvqI6BFSUmnChWMUUlUuSl/JEr1TsiwTgzqVwG0n3E8BHBHJ8\nBVwmqPdnvUeB6C2L8SE4IWXLepL9L3ew5Qt0BxXfgmNG8komgLkpxAMjvb+/\nA6CL+EIU3evl2GP0g7dwtfSJBMBAONFmQjNT0WV+pz6wLu1S7sA5bUPZPDjw\nvPELzEndg5hooYRqhwjSovapSowZaB47oGA8kgNA2RBo/l3tA5CcTg5yOlfJ\nMX+ojmQVWYQjPsA1QsgZk8cRcsjOZ7RLdOa2cOI1Nos1sIEblDZBjgE+86RG\ntyNR+jSKAivH9jk1YcQmQeM7CjTxBN0d7bBhEIUrQVYTrPLfkjJoGlHXcLI+\nlUTfJzIxhl3X4lo1Ms98e8FKmTQActGSviydNdCIDQtRSaQ9hLWAL57BB3aq\n8OrT\r\n=ltSz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"src/index.js","name":"@angular-devkit/build-optimizer","author":{"name":"Angular Authors"},"readme":"# Angular Build Optimizer\n\nAngular Build Optimizer contains Angular optimizations applicable to JavaScript code as a TypeScript transform pipeline.\n\n\n## Available optimizations\n\nTransformations applied depend on file content:\n\n- [Class fold](#class-fold), [Scrub file](#scrub-file) and [Prefix functions](#prefix-functions): applied to Angular apps and libraries.\n- [Import tslib](#import-tslib): applied when TypeScript helpers are found.\n\nNon-transform optimizations are applied via the [Purify Plugin](#purify-plugin).\n\nSome of these optimizations add `/*@__PURE__*/` comments.\nThese are used by [UglifyJS](https://github.com/mishoo/UglifyJS2) to identify pure functions that can potentially be dropped.\n\n\n### Class fold\n\nStatic properties are folded into ES5 classes:\n\n```typescript\n// input\nvar Clazz = (function () { function Clazz() { } return Clazz; }());\nClazz.prop = 1;\n\n// output\nvar Clazz = (function () { function Clazz() { } Clazz.prop = 1; return Clazz; }());\n```\n\n\n### Scrub file\n\nAngular decorators, property decorators and constructor parameters are removed, while leaving non-Angular ones intact.\n\n```typescript\n// input\nimport { Injectable, Input, Component } from '@angular/core';\nimport { NotInjectable, NotComponent, NotInput } from 'another-lib';\nvar Clazz = (function () { function Clazz() { } return Clazz; }());\nClazz.decorators = [{ type: Injectable }, { type: NotInjectable }];\nClazz.propDecorators = { 'ngIf': [{ type: Input }] };\nClazz.ctorParameters = function () { return [{type: Injector}]; };\nvar ComponentClazz = (function () {\n  function ComponentClazz() { }\n  __decorate([\n    Input(),\n    __metadata(\"design:type\", Object)\n  ], Clazz.prototype, \"selected\", void 0);\n  __decorate([\n    NotInput(),\n    __metadata(\"design:type\", Object)\n  ], Clazz.prototype, \"notSelected\", void 0);\n  ComponentClazz = __decorate([\n    NotComponent(),\n    Component({\n        selector: 'app-root',\n        templateUrl: './app.component.html',\n        styleUrls: ['./app.component.css']\n    })\n  ], ComponentClazz);\n  return ComponentClazz;\n}());\n\n// output\nimport { Injectable, Input, Component } from '@angular/core';\nimport { NotInjectable, NotComponent } from 'another-lib';\nvar Clazz = (function () { function Clazz() { } return Clazz; }());\nClazz.decorators = [{ type: NotInjectable }];\nvar ComponentClazz = (function () {\n  function ComponentClazz() { }\n  __decorate([\n    NotInput(),\n    __metadata(\"design:type\", Object)\n  ], Clazz.prototype, \"notSelected\", void 0);\n  ComponentClazz = __decorate([\n    NotComponent()\n  ], ComponentClazz);\n  return ComponentClazz;\n}());\n```\n\n\n### Prefix functions\n\nAdds `/*@__PURE__*/` comments to top level downleveled class declarations and instantiation.\nWebpack library imports are also marked as `/*@__PURE__*/` when used with [Purify Plugin](#purify-plugin).\n\nWarning: this transform assumes the file is a pure module. It should not be used with unpure modules.\n\n```typescript\n// input\nvar Clazz = (function () { function Clazz() { } return Clazz; }());\nvar newClazz = new Clazz();\nvar newClazzTwo = Clazz();\n\n// output\nvar Clazz = /*@__PURE__*/ (function () { function Clazz() { } return Clazz; }());\nvar newClazz = /*@__PURE__*/ new Clazz();\nvar newClazzTwo = /*@__PURE__*/ Clazz();\n```\n\n\n### Prefix Classes\n\nAdds `/*@__PURE__*/` to downleveled TypeScript classes.\n\n```typescript\n// input\nvar ReplayEvent = (function () {\n    function ReplayEvent(time, value) {\n        this.time = time;\n        this.value = value;\n    }\n    return ReplayEvent;\n}());\n\n// output\nvar ReplayEvent = /*@__PURE__*/ (function () {\n    function ReplayEvent(time, value) {\n        this.time = time;\n        this.value = value;\n    }\n    return ReplayEvent;\n}());\n```\n\n\n### Import tslib\n\nTypeScript helpers (`__extends/__decorate/__metadata/__param`) are replaced with `tslib` imports whenever found.\n\n```typescript\n// input\nvar __extends = (this && this.__extends) || function (d, b) {\n  for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n  function __() { this.constructor = d; }\n  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n\n// output\nimport { __extends } from \"tslib\";\n```\n\n### Wrap enums\n\nWrap downleveled TypeScript enums in a function, and adds `/*@__PURE__*/` comment.\n\n```typescript\n// input\nvar ChangeDetectionStrategy;\n(function (ChangeDetectionStrategy) {\n    ChangeDetectionStrategy[ChangeDetectionStrategy[\"OnPush\"] = 0] = \"OnPush\";\n    ChangeDetectionStrategy[ChangeDetectionStrategy[\"Default\"] = 1] = \"Default\";\n})(ChangeDetectionStrategy || (ChangeDetectionStrategy = {}));\n\n// output\nvar ChangeDetectionStrategy = /*@__PURE__*/ (function () {\n  var ChangeDetectionStrategy = {};\n  ChangeDetectionStrategy[ChangeDetectionStrategy[\"OnPush\"] = 0] = \"OnPush\";\n  ChangeDetectionStrategy[ChangeDetectionStrategy[\"Default\"] = 1] = \"Default\";\n  return ChangeDetectionStrategy;\n})();\n```\n\n\n### Purify Plugin\n\nPerforms regex based replacements on all bundles that add `/*@__PURE__*/` comments to\nknown pure webpack imports (used with [Prefix functions](#prefix-functions)).\n\n\n## Library Usage\n\n```typescript\nimport { buildOptimizer } from '@angular-devkit/build-optimizer';\n\nconst transpiledContent = buildOptimizer({ content: input }).content;\n```\n\nAvailable options:\n```typescript\nexport interface BuildOptimizerOptions {\n  content?: string;\n  inputFilePath?: string;\n  outputFilePath?: string;\n  emitSourceMap?: boolean;\n  strict?: boolean;\n  isSideEffectFree?: boolean;\n}\n```\n\n\n## Webpack loader and plugin usage:\n\n```typescript\nconst PurifyPlugin = require('@angular-devkit/build-optimizer').PurifyPlugin;\n\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.js$/,\n        loader: '@angular-devkit/build-optimizer/webpack-loader',\n        options: {\n          sourceMap: false\n        }\n      }\n    ]\n  },\n  plugins: [\n    new PurifyPlugin()\n  ]\n}\n```\n\n\n## CLI usage\n\n```bash\nbuild-optimizer input.js\nbuild-optimizer input.js output.js\npurify input.js\npurify input.js output.js\n```\n","engines":{"npm":">= 5.5.1","node":">= 8.9.0"},"license":"MIT","typings":"src/index.d.ts","_npmUser":{"name":"angular","email":"devops+npm@angular.io"},"homepage":"https://github.com/angular/angular-cli","keywords":["angular","Angular CLI","devkit","sdk","Angular DevKit"],"repository":{"url":"git+https://github.com/angular/angular-cli.git","type":"git"},"_npmVersion":"5.5.1","description":"Angular Build Optimizer","directories":{},"maintainers":[{"name":"angular","email":"angular-core+npm@google.com"},{"name":"angular-devkit","email":"hansl@google.com"}],"_nodeVersion":"8.9.1","dependencies":{"source-map":"^0.5.6","typescript":"~2.9.1","loader-utils":"^1.1.0","webpack-sources":"^1.1.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/build-optimizer_0.8.0-beta.2_1533864615919_0.006824337062790953","host":"s3://npm-registry-packages"},"_id":"@angular-devkit/build-optimizer@0.8.0-beta.2","version":"0.8.0-beta.2"}