{"bin":{"build-optimizer":"./src/build-optimizer/cli.js"},"bugs":{"url":"https://github.com/angular/angular-cli/issues"},"dist":{"shasum":"8eef6bcb5fa90d756a4653c2218ab42ed677cb0f","tarball":"https://registry.npmjs.org/@angular-devkit/build-optimizer/-/build-optimizer-0.9.0-beta.3.tgz","fileCount":30,"integrity":"sha512-Pniin94T5hlJljCDeho59LwuZUmdjbhEK5N+1Uy/HevJVkomGW//5/at4KJ4S8pYMX9EUTASypr7uczlEmo7FA==","signatures":[{"sig":"MEQCIFnqIOSN6TCtvW3+ZV4MtGFqaiRNPxQ3j6iB+mEnuaR7AiBDIfAg7b+8CgcqttLwX29SdjJeidBQtl0MBy+Bqa+fyQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":269347,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbm/HdCRA9TVsSAnZWagAAr0kP/RsoRF1gaqp7ybeyqNh5\n3cxcWYJ9O/tcTZQ1MCDW5kRRrfLuwgrNC3xK0dpTvA82OAJ0cay/vLsokrR7\n92LC1UZpBehXIlVFdj7qhSHH38VbRzqcEtlvz5Q1JkIO7kTGOdkLGNLpHVGn\nphtgFOT46yQI/Hi0w3YGOz3exlm7/UP8rnYb61giM8DG9zDjJBaXtqYY/8g4\no4qgNcQIz2MP2el1GQ0CK9fmAeLCP9PebVVmFK4D2rZmTKlFa9pYrh3G7feH\n+9QOZz+oeNC7q0ebixztbKL7JtO3Ncl8CawZR3QVm7AMzHEPpR3AWcxNqu/h\nBTqMAPQ84AN/y1j01ULWNQzPcBn3YDBTZjGXgOMVVuQI7T/HnNDGptf2XH/H\nDHMsUyvaTV7RztyV3Z7DgyQChvhouSl2LayaKP51ym+nO4V4g8xg2XomW42h\n/63wb6r9pkn2RyI1chzbMh6jaSpXQX0sl7m1y48wVYOgIK9uBWLhmq5KGGEX\n49/1ZKXxaONJFceij7m8XdjCt2GjXRdWz0hhuBQgY4z5Xpj/PTEmEGOxZXFG\n5BsNjvHXpUC1whz5GWozrq2n7jZE7ZAgj1Wvc08A1sJfwaVXyyUM7swA++Bj\nIzFKiL/cWhzT2pLs77veHBG3XIcrVtIKOFk0eRZEPCBm+rIZFmTCMpKbKHNs\nL1cE\r\n=+f8y\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\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.\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## 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 usage:\n\n```typescript\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}\n```\n\n\n## CLI usage\n\n```bash\nbuild-optimizer input.js\nbuild-optimizer input.js output.js\n```\n","engines":{"node":">=10.9.0 <11.0.0","yarn":">=1.9.0 <2.0.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":"6.1.0","description":"Angular Build Optimizer","directories":{},"maintainers":[{"name":"angular","email":"angular-core+npm@google.com"},{"name":"angular-devkit","email":"hansl@google.com"}],"_nodeVersion":"10.7.0","dependencies":{"source-map":"0.5.6","typescript":"3.0.1","loader-utils":"1.1.0","webpack-sources":"1.2.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/build-optimizer_0.9.0-beta.3_1536946652372_0.24201810988213168","host":"s3://npm-registry-packages"},"_id":"@angular-devkit/build-optimizer@0.9.0-beta.3","version":"0.9.0-beta.3"}