babel-plugin-constant-folding

Compile static constants (ie. code that we can statically determine to be constant at runtime)

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
babel-plugin-constant-folding
1.0.17 years ago7 years agoMinified + gzip package size for babel-plugin-constant-folding in KB

Readme

babel-plugin-constant-folding
Compile static constants (ie. code that we can statically determine to be constant at runtime)

Installation

$ npm install babel-plugin-constant-folding

Usage

Via .babelrc (Recommended)

.babelrc
{
  "plugins": ["constant-folding"]
}

Via CLI

$ babel --plugins constant-folding script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["constant-folding"]
});