This is a plugin for the Ease task runner. It uses the terser module to minify JS files.
npm install ease-task-minify-js --save-dev
easeconfig.js:
const minifyJs = require('ease-task-minify-js');
module.exports = ease => {
ease.install('minify-js', minifyJs, {});
};
This plugin takes a config object similar to Terser Minify Options while adding the following properties:
dir
: Path to a directory containing all the SASS files, relative toeaseconfig.js
outDir
: Path to the output directory where the CSS files should be written, relative toeaseconfig.js
cleanOutDir
: Boolean indicating if the output directory should be emptied first
easeconfig.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