https://github.com/danielhaim1/terser-dir
Run terser on a folder, minify the results into a file/folder.
https://github.com/danielhaim1/terser-dir
Last synced: about 1 year ago
JSON representation
Run terser on a folder, minify the results into a file/folder.
- Host: GitHub
- URL: https://github.com/danielhaim1/terser-dir
- Owner: danielhaim1
- License: mit
- Created: 2019-11-05T13:29:03.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-02-21T06:46:46.000Z (over 1 year ago)
- Last Synced: 2025-03-23T06:11:23.915Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 539 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
terser-dir
==========

[](https://www.npmjs.com/package/terser-dir)
[](https://www.npmjs.com/package/terser-dir)

Command to run `terser` on a folder and minify the result in a single file or a new folder.
Getting Started
---------------
Install the module with: `npm i terser-dir`
Documentation
-------------
### Usage
```shell
terser-dir path [options]
--output Specify a file/folder to write the minified code
--config-file Specify a configuration file for Terser
--help Print this list and exit.
```
### Examples
```shell
$ terser-dir src/js --output .bundle/
$ terser-dir src/js --output .bundle/all.min.js
$ terser-dir demo/files --config-file demo/config.json
$ terser-dir demo/files --output app-test-noconfig.min.js
```
### Configuration Options
You can also specify a configuration file in JSON format. The configuration file can define input files, output paths, and debugging options.
```json
{
"input": [
"demo/files/file1.js",
"demo/files/dir1/file2.js"
],
"output": "dist/app-test-config.min.js",
"debug": true
}
```
### Output Files
The output file can be customized, for example:
* `app-test-config.min.js` - when using a configuration file.
* `app-test-noconfig.min.js` - when specifying input files directly.