JSPM

babel-minify

0.1.11
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 24407
  • Score
    100M100P100Q140076F
  • License MIT

Babel minify Node API and CLI

Package Exports

  • babel-minify

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (babel-minify) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

babel-minify

Node API + CLI

Install

npm install babel-minify --save-dev

Example

import minify from 'babel-minify';
const outputCode = minify(inputCode, {
  conditionals: true,
  drop_debugger: true
});

Options

Options and defaults

{
  mangle         = true,
  mangle_globals = false,

  dead_code      = false,
  conditionals   = true,
  evaluate       = true, // eval constant expressions
  drop_debugger  = false,
  drop_console   = false,
  properties     = true,
  join_vars      = true,
  booleans       = true,
  unsafe         = true,
  keep_fnames    = false,

  // number of passes
  npasses        = 1,

  // passed on to babel transform to tell whether to use babelrc
  babelrc        = false,

  // should there be any other plugins added to this build process
  plugins        = [],

  // should there be any other presets
  presets        = [],

  // if false, babel-minify can give a list of plugins to use as a preset
  minify         = true,
}

Internals

Plugins used for specific options