https://github.com/chisel/ease-task-minify-js
JS minifier for Ease task runner.
https://github.com/chisel/ease-task-minify-js
Last synced: 5 months ago
JSON representation
JS minifier for Ease task runner.
- Host: GitHub
- URL: https://github.com/chisel/ease-task-minify-js
- Owner: chisel
- Created: 2019-06-30T01:58:48.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-07-20T01:29:39.000Z (over 3 years ago)
- Last Synced: 2025-01-29T01:40:00.254Z (about 1 year ago)
- Language: JavaScript
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ease Task Runner JS Minifier Plugin
This is a plugin for the [Ease task runner](https://github.com/chisel/ease). It uses the [terser](https://www.npmjs.com/package/terser) module to minify JS files.
# Installation
```
npm install ease-task-minify-js --save-dev
```
**easeconfig.js:**
```js
const minifyJs = require('ease-task-minify-js');
module.exports = ease => {
ease.install('minify-js', minifyJs, {});
};
```
# Configuration
This plugin takes a config object similar to [Terser Minify Options](https://www.npmjs.com/package/terser#minify-options) while adding the following properties:
- `dir`: Path to a directory containing all the SASS files, relative to `easeconfig.js`
- `outDir`: Path to the output directory where the CSS files should be written, relative to `easeconfig.js`
- `cleanOutDir`: Boolean indicating if the output directory should be emptied first
# Example
**easeconfig.js:**
```js
const minifyJs = require('ease-task-minify-js');
module.exports = ease => {
ease.install('minify-js', minifyJs, {
dir: 'js',
outDir: 'minified-js',
cleanOutDir: false,
sourceMap: true,
mangle: {
toplevel: true
}
});
ease.job('minify-js-files', ['minify-js']);
};
```
**CLI:**
```
ease minify-js-files
```