ncc
esbuild
Our great sponsors
ncc | esbuild | |
---|---|---|
15 | 291 | |
7,599 | 34,927 | |
2.0% | - | |
8.6 | 9.8 | |
8 days ago | 3 days ago | |
JavaScript | Go | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
ncc
-
So you're using a weird language
You could use ncc to compile a binary:
-
Contributors to AWS Lambda container cold starts
This appears to be caused by lazy loading of image layer data, particularly during container initialization, and latency introduced by the read operations. In general, you want to access as few files and as little data as possible during the initialization of your functions. For example, we've seen improvement when using ncc to bundle Node.js applications.
-
Tools of the Trade: Dyte CLI
What we do however, is bundle all these dependencies, and our own code into a single JS file using the nifty ncc tool (thanks Vercel!)
-
Label automation at your fingertips
Vercel's ncc compiler
-
Managing JavaScript GitHub Action ncc packing
The most unclear and confusing part is packing the code using ncc. The necessity of this step is caused by GitHub’s approach to running your Action.
-
Ask HN: How do you (security) audit external software using NPM packages?
This may be slightly tangential but I recently discovered ncc[1] from vercel which can take a single node project and compile it and all dependencies to a single file.
As an added benefit it also collapses all contained dependencies license files into a single licenses.txt file too!
-
Compiling a Apollo Federated Graph with esBuild 🚀
The current process of building a package locally is by running through a gulp task, using ttypescript to compile the TS and @vercel/ncc to build the binary:
-
I launched Autobundle project which automatic bundle your dependency, ideally from Bundlephobia, powered by esbuild
- "introduce bugs": I dont' think so, my product is running like this, bundling every commit but I didn't see any problem. For bigger app: vercel using this way to delivery they's serverless application with https://github.com/vercel/ncc.
-
Solution to serverless function getting too big?
Here is link number 1 - Previous text "ncc"
esbuild
-
Benchmarking the AWS SDK
The other option I want to highlight is packaging the project using something like Webpack or esbuild. JS Bundlers transpile all of your separate files and classes (along with all node_modules) into one single file, a practice originally developed to reduce package size for frontend applications. This helps improve the cold start time in Lambda, as unimported files can be pruned and the entire handler becomes one file.
-
Rspack: A fast Rust-based web bundler
I wonder how this compares (performance and feature-wise) to esbuild (https://github.com/evanw/esbuild), which is also a bundler written in a compiled language (Go)? esbuild claims to be 10-100x faster than JS-based builders, while Rspack doesn't provide any concrete numbers (at least I didn't find any)...
-
What’s New With Nuxt 3
It uses esbuild so you can write the latest JavaScript syntax while supporting older browsers,
-
Anyone else doing compiler work in Golang?
The javascript bundler esbuild is written in Go and is extremely fast for that reason. The author originally tried both Rust and Go and ended up using Go. There is a discussion of why he chose Go here: https://news.ycombinator.com/item?id=22336284
-
Building a Node API with Fastify, esbuild, and Nx
Now that we have our production-ready app, let’s examine how Nx handles the build process using [esbuild](https://esbuild.github.io/).
-
Configure Stimulus with esbuild and Babel — Rails & Javascript
// config/esbuild.mjs import path from 'path' import esbuild from 'esbuild' import rails from 'esbuild-rails' import babel from 'esbuild-plugin-babel' esbuild .build({ bundle: true, // Path to application.js folder absWorkingDir: path.join(process.cwd(), 'app/javascript'), // Application.js file, used by Rails to bundle all JS Rails code entryPoints: ['application.js'], // Destination of JS bundle, points to the Rails JS Asset folder outdir: path.join(process.cwd(), 'app/assets/builds'), // Enables watch option. Will regenerate JS bundle if files are changed watch: process.argv.includes('--watch'), // Split option is disabled, only needed when using multiple input files // More information: https://esbuild.github.io/api/#splitting (change it if using multiple inputs) splitting: false, chunkNames: 'chunks/[name]-[hash]', // Remove unused JS methods treeShaking: true, // Adds mapping information so web browser console can map bundle errors to the corresponding // code line and column in the real code // More information: https://esbuild.github.io/api/#sourcemap sourcemap: process.argv.includes('--development'), // Compresses bundle // More information: https://esbuild.github.io/api/#minify minify: process.argv.includes('--production'), // Removes all console lines from bundle // More information: https://esbuild.github.io/api/#drop drop: process.argv.includes('--production') ? ['console'] : [], // Build command log output: https://esbuild.github.io/api/#log-level logLevel: 'info', // Set of ESLint plugins plugins: [ // Plugin to easily import Rails JS files, such as Stimulus controllers and channels // https://github.com/excid3/esbuild-rails rails(), // Configures bundle with Babel. Babel configuration defined in babel.config.js // Babel translates JS code to make it compatible with older JS versions. // https://github.com/nativew/esbuild-plugin-babel babel() ] }) .catch(() => process.exit(1))
-
Integrating a complex JavaScript library, three.js, that uses <script type="module"> import and export (Tweego compiler)
You can also roll-up your JS files using a bundler. I use esbuild, and a plugin called glslify so I can include .glsl files, to integrate ThreeJS into my Twine projects.
-
Justifying a Backwards Design Decision for My Programming Language
esbuild.
- You don't say
-
How can I make my CRA server start up quicker?
You should know that CRA is using webpack and babeljs for bundling and compiling the js, jsx to es5( based on your configs), and these two are pretty damn slow! you can change babel with esbuild which you can read here and also there are other articles out there... this will make a hige speedup for you because you are replacing those two which is written by javascript with esbuild which is written by golang that is pretty (fast](https://esbuild.github.io/), actually vite is using esbuild behind the scene and that is why its is super fast!
What are some alternatives?
swc - Rust-based platform for the Web
vite - Next generation frontend tooling. It's fast!
Rollup - Next-generation ES module bundler
webpack - A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows for loading parts of the application on demand. Through "loaders", modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ... and your custom stuff.
parcel - The zero configuration build tool for the web. 📦🚀
terser - 🗜 JavaScript parser, mangler and compressor toolkit for ES6+
pkg - Package your Node.js project into an executable
Tailwind CSS - A utility-first CSS framework for rapid UI development.
ts-node - TypeScript execution and REPL for node.js
import-maps - How to control the behavior of JavaScript imports
tsup - The simplest and fastest way to bundle your TypeScript libraries.
PostCSS - Transforming styles with JS plugins