Compressors
Babel Minify

babel-minify

babel-minify can compress only JavaScript files.

https://github.com/babel/minify (opens in a new tab)

Usage

const minify = require('@node-minify/core');
const babelMinify = require('@node-minify/babel-minify');
 
minify({
  compressor: babelMinify,
  input: 'foo.js',
  output: 'bar.js',
  callback: function(err, min) {}
});

Options

minify({
  compressor: babelMinify,
  input: 'foo.js',
  output: 'bar.js',
  options: {
    babelrc: 'public/.babelrc',
    presets: ['env']
  },
  callback: function(err, min) {}
});

Check all options (opens in a new tab)

Last updated on December 5, 2022