babel-plugin-constant-folding

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

MIT 1 个版本
安装
npm install babel-plugin-constant-folding
yarn add babel-plugin-constant-folding
pnpm add babel-plugin-constant-folding
bun add babel-plugin-constant-folding
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

.babelrc

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

Via CLI

$ babel --plugins constant-folding script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["constant-folding"]
});
版本列表
1.0.1 2015-06-15