A JavaScript bundler and minifier implemented in C++ aimed at excellent performance.
MIT License
| | WASM Online Demo
jetpack.js
is an extremely fast js bundler and minifier written in C++.
npm install -g jetpp
Use command line to bundle a js module.
jetpp main.js --out bundle.js
Help command:
$ jetpp --help
Jetpack command line
Usage:
Jetpack [OPTION...] positional parameters
--tolerant tolerant parsing error
--jsx support jsx syntax
--library bundle as library, do not bundle node_modules
--help produce help message
--analyze-module arg analyze a module and print result
--no-trace do not trace ref file when analyze module
--minify minify the code
--out arg output filename of bundle
--sourcemap generate sourcemaps
const jetpp = require('jetpp');
console.log(jetpp.minify('let hello = "world";'));
WASM gives you the power of running Jetpack.js in the browser environment.
yarn add jetpp-wasm
import loadJetpack from 'jetpp-wasm';
async function main(code) {
const jetpack = await loadJetpack();
console.log(jetpack.minify(code)); // minify
console.log(jetpack.parse(code)); // parse
}
jetpack.js
supports all popular system including: