merger-js
Yet another light weight and simple build tool for JavaScript files, with auto build capabilities and smart CLI tooling.
Because merger uses uglify-es for minification, you don't need to use any kind of transpilers in conjunction with this tool. You can use ES6+.
This tool is intended for very small projects.
merger does not support circular dependencies
NPM: LINK
GitHub: LINK
License: MIT
Dependencies:
├── uglify-es
├── async9
├── chokidar
├── commander
├── inquirer
Getting Started
1) Node.js
You will need Node.js installed to run merger.
2) Install merger with NPM
Install globally -g
with NPM:
npm i merger-js -g
or
npm install merger-js -g
Use
- Run
merger init
on your working JS directory:
-
If you run it on your working JS directory, the CLI tool will give you default file paths and names relative to that directory.
-
In the question "File Order", input in which order you wish the files to be bundled. From first to last.
(eg.: helpers.js, requests.js, handlers.js, listeners.js, feature.js
)
- After having a merger-config.json file on the source directory (the directory where your working files are located), you have different alternatives to run merger:
- You can run
merger
or merger build
, on the source directory, and the merger-config.json folder will be parsed and merger will build with the config you gave it on the config file. - You can run
merger auto
or merger build auto
to run a one time auto build session (it watches the source directory for changes and builds when there's one), if you, for example, told the CLI that you didn't want auto builds and you don't want to change that.