js-bundle

A command line tool for bundling .js files into a single minified file

Usage no npm install needed!

<script type="module">
  import jsBundle from 'https://cdn.skypack.dev/js-bundle';
</script>

README

js-bundle

This is a command line tool to bundle multiple .js files into a single minified version.

usage

Download:

    npm install js-bundle -g

Runn the script using:

    js-bundle <options> inputFile outputFile

Where input file is the search path to the file or folder to compress and outpuFile is the path to the output file. This file need not exist. A new file will be created at the path if the file was not found.

Since the output from running this script will be minified content, it would be wise to name the output file to something ending on .min.js

Options

The -l (that would be a lower case L) flag can be used to make the script listen to the specified file or folder and work as an auto compiler that will compile your files on save.

Note

  1. The input file must not contain anything but js files
  2. Every file in the input folder will be compiled. This script does not read your .gitignore or anything like that
  3. Watching a large number of files might cause some performance loss