Socket
Socket
Sign inDemoInstall

@angular-devkit/build-optimizer

Package Overview
Dependencies
Maintainers
3
Versions
481
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@angular-devkit/build-optimizer

Angular Build Optimizer


Version published
Weekly downloads
335K
increased by2.42%
Maintainers
3
Weekly downloads
 
Created

What is @angular-devkit/build-optimizer?

@angular-devkit/build-optimizer is a tool designed to optimize Angular applications by performing various transformations and optimizations on the build output. It helps in reducing the size of the final bundle and improving the performance of the application.

What are @angular-devkit/build-optimizer's main functionalities?

Tree Shaking

Tree shaking is a feature that removes unused code from the final bundle. The code sample demonstrates how to use the buildOptimizer function to perform tree shaking on a given input code.

const { buildOptimizer } = require('@angular-devkit/build-optimizer');
const inputCode = 'import { Component } from "@angular/core";';
const result = buildOptimizer({ content: inputCode, inputFilePath: 'app.component.ts' });
console.log(result.content);

Inlining

Inlining is a feature that replaces external resources (like templates and styles) with inline content. The code sample shows how to use the buildOptimizer function to inline a template string in the input code.

const { buildOptimizer } = require('@angular-devkit/build-optimizer');
const inputCode = 'const template = `<div>{{title}}</div>`;';
const result = buildOptimizer({ content: inputCode, inputFilePath: 'app.component.ts' });
console.log(result.content);

Dead Code Elimination

Dead code elimination is a feature that removes code that is never used or executed. The code sample demonstrates how to use the buildOptimizer function to eliminate dead code from the input code.

const { buildOptimizer } = require('@angular-devkit/build-optimizer');
const inputCode = 'function unusedFunction() { return "I am not used"; }';
const result = buildOptimizer({ content: inputCode, inputFilePath: 'app.component.ts' });
console.log(result.content);

Other packages similar to @angular-devkit/build-optimizer

Keywords

FAQs

Package last updated on 13 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc