npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

towify-ngc-esbuild

v0.0.17

Published

Towify Angular Esbuild Compiler

Downloads

41

Readme

NPM version


Content

Comparison ⏱

50x faster builds with esbuild, production build within 200ms instead of 10s

ngc-esbuild:

image description

ng build:

image description

Features ✨

  • Build Angular projects
  • Process SCSS
  • Process 3rc styles and scripts
  • Handle loadChildren

Install 🐙

# globally
npm i -g ngc-esbuild
# or locally
npm i ngc-esbuild

Usage 💡

  • Add a new script to the package.json:
"scripts": {
  "esbuild": "ngc-esbuild"
}
  • Start esbuild:
npm run esbuild
  • With arguments:
"scripts": {
  "esbuild": "ngc-esbuild --minify true --sourcemap false --port 6500 --open"
}
  • From nodejs:
const NgcEsbuild = require('ngc-esbuild');

new NgcEsbuild({
  main: 'src/main.ts',
  outpath: 'dist/es2',
  minify: true,
  open: false,
  port: 9855,
  sourcemap: true,
  serve: true,
}).resolve.then(
  (result) => console.log(result)
);

Arguments:

  • These arguments are supported both from cmd and the nodejs call:
{
    // special options for this package:
    port: 4200, // live-server port
    open: false, // open in default browser
    serve: true, // start the live-server
    project: '', // project name from the angular.json file
    
    // esbuild options:
    entryPoints: ['src/main.ts'], // main
    bundle: true, // true|false
    outfile: '', // string
    outdir: 'dist/esbuild', // outpath
    external: [], // eg: ['fsevents']
    format: 'esm', // iife, cjs, or esm
    inject: [], // eg: ['./process-shim.js']
    minify: true, // true|false
    platform: 'browser', // node|browser|neutral
    sourcemap: true, // true|false|'external'|'inline'|'both'
    splitting: true, // true|false
    target: ['es2020'], // ['es2020', 'chrome58', 'firefox57',  'safari11',  'edge16',  'node12',],
    watch: true, // true|false|object
    write: true, // true|false
    allowOverwrite: true, // true|false
    metafile: false, // true|false - for the analyze feature
    treeShaking: true, // true|false
    tsconfig: 'tsconfig.json', // string
    tsconfigRaw: '',
    absWorkingDir: process.cwd(), // string: a file-system path
}

Documentation 📄

WARNING!
The package is in the early alpha version!

This package is based on the esbuild.
Esbuild is an extremely fast builder for web projects, written in GoLang.
I extended esbuild with its plugin API and created some internal plugins.
These plugins process .ts files, handle dependency injectors, unpack styles, etc.

Limitations

| build part | supported | notice | | ---------------------- | --------- | ------------------------------------------------ | | templateUrl | Yes | move to import statement | | styleUrls | Partial | only one styleUrl | | angular.json:styles | Yes | move to main.css | | angular.json:scripts | Yes | move to vendor.js | | dependency injection | Partial | constructor must contain only injectable objects | | loadChildren | Yes | move to a separated file | | assets | Yes | copy to the output folder | | scss :root | No | angular pseudo-selectors are not supported yet | | less | No | less stylesheets are not supported yet | | style encapsulation | No | work in progress |

Contributing 🍰

Thank you to all the people who contributed to this project! You feel free to send pull requests.
Contributing Guide

Maintainers 👷

License ⚖️

MIT