babel-preset-optimized

1.0.2 • Public • Published

babel-preset-optimzed

This is a collection of presets which (should) result in optimized code. It is reccomended to avoid using the preset for development as it may strip out some warnings, but that is not required. See below for configuration

This is a list of plugins this uses. Do note that by default, not all of these may run:

This may be expanded in the future, feel free to send a PR too

Installation

$ npm install babel-preset-optimzed

Usage

Via .babelrc (Recommended)

.babelrc

{
  "presets": ["optimzed"]
}

Via CLI

$ babel --presets optimzed script.js

Via Node API

require('babel').transform('code', {
  presets: ['optimzed']
});

Configuration

By default, not all optimizations are run. You have to set certain configurations to allow some optimizations to be run. You can set this options object by changing 'optimized' (in the presets: array) to ['optimized' { ... options ... }]

Unsafe Optimizations

 unsafe: true

This enables optimizations which would otherwise result in code with slightly different behavior. This includes:

Readme

Keywords

none

Package Sidebar

Install

npm i babel-preset-optimized

Weekly Downloads

1

Version

1.0.2

License

ISC

Last publish

Collaborators

  • vihanb