Switch branches/tags
Find file History
boopathi Publish
 - babel-helper-evaluate-path@0.4.3
 - babel-helper-flip-expressions@0.4.3
 - babel-helper-is-void-0@0.4.3
 - babel-helper-mark-eval-scopes@0.4.3
 - babel-helper-remove-or-void@0.4.3
 - babel-helper-to-multiple-sequence-expressions@0.4.3
 - babel-minify@0.4.3
 - babel-plugin-minify-builtins@0.4.3
 - babel-plugin-minify-constant-folding@0.4.3
 - babel-plugin-minify-dead-code-elimination@0.4.3
 - babel-plugin-minify-flip-comparisons@0.4.3
 - babel-plugin-minify-guarded-expressions@0.4.3
 - babel-plugin-minify-infinity@0.4.3
 - babel-plugin-minify-mangle-names@0.4.3
 - babel-plugin-minify-numeric-literals@0.4.3
 - babel-plugin-minify-replace@0.4.3
 - babel-plugin-minify-simplify@0.4.3
 - babel-plugin-minify-type-constructors@0.4.3
 - babel-plugin-transform-inline-consecutive-adds@0.4.3
 - babel-plugin-transform-inline-environment-variables@0.4.3
 - babel-plugin-transform-member-expression-literals@6.9.4
 - babel-plugin-transform-merge-sibling-variables@6.9.4
 - babel-plugin-transform-minify-booleans@6.9.4
 - babel-plugin-transform-node-env-inline@0.4.3
 - babel-plugin-transform-property-literals@6.9.4
 - babel-plugin-transform-regexp-constructors@0.4.3
 - babel-plugin-transform-remove-console@6.9.4
 - babel-plugin-transform-remove-debugger@6.9.4
 - babel-plugin-transform-remove-undefined@0.4.3
 - babel-plugin-transform-simplify-comparison-operators@6.9.4
 - babel-plugin-transform-undefined-to-void@6.9.4
 - babel-preset-minify@0.4.3
 - gulp-babel-minify@0.4.3
Latest commit 6889f45 May 15, 2018
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
__tests__ chore: upgrade dependencies; add node 10; remove node 9 (#827) May 1, 2018
src chore(deps): upgrade deps (#765) Dec 20, 2017
.npmignore ignore *.log Jun 29, 2016
README.md add --save-dev to all packages' install instruction (#833) [skip ci] May 5, 2018
package.json Publish May 14, 2018

README.md

babel-plugin-minify-type-constructors

Note: Not recommended if full support for IE8 and lower is required. Details

Example

In

Boolean(x);
Number(x);
String(x);
Array(3);
Array(3,1);
Object({foo: 'bar'});

Out

!!x;
+x;
x + "";
[,,,];
[3, 1];
{foo: 'bar'};

Installation

npm install babel-plugin-minify-type-constructors --save-dev

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["minify-type-constructors"]
}

Via CLI

babel --plugins minify-type-constructors script.js

Via Node API

require("@babel/core").transform("code", {
  plugins: ["minify-type-constructors"]
});

Options

  • array - prevent plugin from minifying arrays
  • boolean - prevent plugin from minifying booleans
  • number — prevent plugin from minifying numbers
  • object — prevent plugin from minifying objects
  • string — prevent plugin from minifying strings