{"bin":{"build-optimizer":"src/build-optimizer/cli.js"},"bugs":{"url":"https://github.com/angular/angular-cli/issues"},"dist":{"shasum":"9d43dc531848a51845369f6c2e0c49369f43bba5","tarball":"https://registry.npmjs.org/@angular-devkit/build-optimizer/-/build-optimizer-0.1202.0-next.2.tgz","fileCount":30,"integrity":"sha512-93zbZQtl0WvZRLO/ze02Qrrnfp8zLaVKW4JuTl5aSLjecdPaIxKBwzIhedp70KX0znM81T/9urKu4nCfmtOKYQ==","signatures":[{"sig":"MEUCIQCz2z7aQX25DG9SxVWZCQsfCzXU2CdV8F0Ybc1TCP2a3wIgcZ2z2JYUy8+TJAmPOVDwB0qNdTOOd5cecQ0Cx3/e2W8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88616,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg73gLCRA9TVsSAnZWagAAcqMQAJumOVipWJC9bwzF+tiZ\no8dKfTVBIVA19rbMQ5q2/c527U4Oj9XOE36XZASEeo09+X3DD9s7JfCxXYPA\nomBqnRCO3+lEeOVE6m3v4eLEUP9rabt1zoJt2JIs0cFt7d0f5Ie6iOm5NPIp\ntTu7Dv9CHdifUdZn+iLPVuhZSarjmackmPUf2n8F4oLuGop3o3RmkESs85jH\niRmH3Sq/d6uOijJoR/BFN8KtFX5oL7sIxLVUoT4lBEF2aBmLMsmNVnH6Ixt+\n9vHgP6aOnpn+6NflWL3lKT2bGciwddBHPYhw0l0YZKqqBKBI9YMTG8dcwv3R\nNSMHUSZ3z8ncP22fkAIN1HzDbAARdgOIzUtiHvtx+yYw5Vtek/8URc7R0NqX\nauBZFwMvjeNO3thGTfA5FelbWF774HymqwYduBMOouSDmT0OV5e8nKdy1O/M\nAcBFNbpkuesHlPjI+B555oMcvQicWQ1GFIqGKOf8DeWRWOmJd2xcWdPnTMJk\nu8Zf1ESVOukYIHJQub26Z+mBbppkTdtifMHeoztE4/0ZMnqHtrh9j8rqk/K+\n7u5bKUPAi0BLCw7vwoz4pYZ2ubJl7ESYjxkQQxWDXM6VSFxKFSiW8bHFokaa\nBaJc31I22u3jhjl5IszXbNCYxSTFw3/RJUmjipJsaT40s6gYzQQXf3icxxnZ\nWbhx\r\n=TEUz\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## 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 JS optimization tools to identify pure functions that can potentially be dropped.\n\n### Class fold\n\nStatic properties are folded into ES5 classes:\n\n```typescript\n// input\nvar Clazz = (function () {\n  function Clazz() {}\n  return Clazz;\n})();\nClazz.prop = 1;\n\n// output\nvar Clazz = (function () {\n  function Clazz() {}\n  Clazz.prop = 1;\n  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 () {\n  function Clazz() {}\n  return Clazz;\n})();\nClazz.decorators = [{ type: Injectable }, { type: NotInjectable }];\nClazz.propDecorators = { 'ngIf': [{ type: Input }] };\nClazz.ctorParameters = function () {\n  return [{ type: Injector }];\n};\nvar ComponentClazz = (function () {\n  function ComponentClazz() {}\n  __decorate([Input(), __metadata('design:type', Object)], Clazz.prototype, 'selected', void 0);\n  __decorate(\n    [NotInput(), __metadata('design:type', Object)],\n    Clazz.prototype,\n    'notSelected',\n    void 0,\n  );\n  ComponentClazz = __decorate(\n    [\n      NotComponent(),\n      Component({\n        selector: 'app-root',\n        templateUrl: './app.component.html',\n        styleUrls: ['./app.component.css'],\n      }),\n    ],\n    ComponentClazz,\n  );\n  return ComponentClazz;\n})();\n\n// output\nimport { Injectable, Input, Component } from '@angular/core';\nimport { NotInjectable, NotComponent } from 'another-lib';\nvar Clazz = (function () {\n  function Clazz() {}\n  return Clazz;\n})();\nClazz.decorators = [{ type: NotInjectable }];\nvar ComponentClazz = (function () {\n  function ComponentClazz() {}\n  __decorate(\n    [NotInput(), __metadata('design:type', Object)],\n    Clazz.prototype,\n    'notSelected',\n    void 0,\n  );\n  ComponentClazz = __decorate([NotComponent()], ComponentClazz);\n  return ComponentClazz;\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 () {\n  function Clazz() {}\n  return Clazz;\n})();\nvar newClazz = new Clazz();\nvar newClazzTwo = Clazz();\n\n// output\nvar Clazz = /*@__PURE__*/ (function () {\n  function Clazz() {}\n  return Clazz;\n})();\nvar newClazz = /*@__PURE__*/ new Clazz();\nvar newClazzTwo = /*@__PURE__*/ Clazz();\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### Import tslib\n\nTypeScript helpers (`__extends/__decorate/__metadata/__param`) are replaced with `tslib` imports whenever found.\n\n```typescript\n// input\nvar __extends =\n  (this && this.__extends) ||\n  function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() {\n      this.constructor = d;\n    }\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## Library Usage\n\n```typescript\nimport { buildOptimizer } from '@angular-devkit/build-optimizer';\n\nconst transpiledContent = buildOptimizer({ content: input }).content;\n```\n\nAvailable options:\n\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## Webpack loader usage:\n\n```typescript\nimport { BuildOptimizerWebpackPlugin } from '@angular-devkit/build-optimizer';\n\nmodule.exports = {\n  plugins: [\n    new BuildOptimizerWebpackPlugin(),\n  ]\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## CLI usage\n\n```bash\nbuild-optimizer input.js\nbuild-optimizer input.js output.js\n```\n","engines":{"npm":"^6.11.0 || ^7.5.6","node":"^12.14.1 || >=14.0.0","yarn":">= 1.13.0"},"license":"MIT","typings":"src/index.d.ts","_npmUser":{"name":"google-wombot","email":"node-team-npm+wombot@google.com"},"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.14.13","description":"Angular Build Optimizer","directories":{},"maintainers":[{"name":"angular","email":"devops+npm@angular.io"},{"name":"angular-devkit","email":"devops+npm@angular.io"},{"name":"google-wombot","email":"node-team-npm+wombot@google.com"}],"_nodeVersion":"14.17.0","dependencies":{"tslib":"2.3.0","source-map":"0.7.3","typescript":"4.3.5"},"experimental":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","peerDependencies":{"webpack":"^5.30.0"},"peerDependenciesMeta":{"webpack":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/build-optimizer_0.1202.0-next.2_1626306571356_0.45611249670593357","host":"s3://npm-registry-packages"},"_id":"@angular-devkit/build-optimizer@0.1202.0-next.2","version":"0.1202.0-next.2"}