0.0.83 • Published 1 year ago

ngc-esbuild v0.0.83

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

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 partsupportednotice
templateUrlYesmove to import statement
styleUrlsPartialonly one styleUrl
angular.json:stylesYesmove to main.css
angular.json:scriptsYesmove to vendor.js
dependency injectionPartialconstructor must contain only injectable objects
loadChildrenYesmove to a separated file
assetsYescopy to the output folder
scss :rootNoangular pseudo-selectors are not supported yet
lessNoless stylesheets are not supported yet
style encapsulationNowork 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

0.0.80

2 years ago

0.0.81

2 years ago

0.0.82

1 year ago

0.0.83

1 year ago

0.0.76

2 years ago

0.0.77

2 years ago

0.0.78

2 years ago

0.0.79

2 years ago

0.0.75

2 years ago

0.0.74

2 years ago

0.0.73

2 years ago

0.0.72

2 years ago

0.0.71

2 years ago

0.0.70

2 years ago

0.0.69

2 years ago

0.0.68

2 years ago

0.0.67

2 years ago

0.0.65

2 years ago

0.0.64

2 years ago

0.0.63

2 years ago

0.0.62

2 years ago

0.0.61

2 years ago

0.0.60

2 years ago

0.0.59

2 years ago

0.0.57

2 years ago

0.0.56

2 years ago

0.0.55

2 years ago

0.0.54

2 years ago

0.0.53

2 years ago

0.0.52

2 years ago

0.0.51

2 years ago

0.0.50

2 years ago

0.0.49

2 years ago

0.0.48

2 years ago

0.0.47

2 years ago

0.0.46

2 years ago

0.0.45

2 years ago

0.0.42

2 years ago

0.0.41

2 years ago

0.0.38

2 years ago

0.0.37

2 years ago

0.0.36

2 years ago

0.0.35

2 years ago

0.0.34

2 years ago

0.0.33

2 years ago

0.0.32

2 years ago

0.0.3

2 years ago

0.0.24

2 years ago

0.0.23

2 years ago

0.0.22

2 years ago