@effectfuljs/babel-preset-env
v0.0.1
Published
babel autoprefixer with mfjs enabled
Downloads
6
Maintainers
Readme
@effectfuljs/babel-preset-env
Babel preset augmenting babel-preset-env to enable Effectful.js translations.
Install
$ npm install --save-dev babel-preset-env @effectfuljs/babel-preset-env
Usage
Via .babelrc
.babelrc
{
"presets": ["@effectfuljs/env"]
}
It supports the same arguments as babel-preset-env, e.g.
{
"presets": [
["env", {
"targets": {
"chrome": 52
}
}]
]
}
To specify effectfuljs options use "effectfuljs" field in the arguments object:
{
"presets": [
["env", {
"effectfuljs": {
"require": "@effectfuljs/generators"
}
}]
]
}
Via CLI
$ babel script.js --presets @effectfuljs/env
Via Node API
require("babel-core").transform("code", {
presets: ["@effectfuljs/env"]
});
Rationale
Why not separate preset without env
.
The current version of Effectful.js transpiler supports only full ES5
syntax with a few ES6 extensions. Making separate preset and
running it after env
will not work well too, because Effectful.js wants to
recognize the ES6 extensions it supports to generate better code.
For example for for-of
and ES6 imports. This preset also
automatically enables env extensions Effectful.js doesn't support even
if they are excluded in env
.
After Effectful.js implements the whole latest JS extensions it will be a separate preset or plugin.
LICENSE
Copyright © 2017 Vitaliy Akimov
Distributed under the terms of The MIT License (MIT).