es6-transpiler-config
v1.0.2
Published
simple utility for transpiling ES6 and beyond
Downloads
1
Readme
simple utility for transpiling ES6 and beyond
While under the hood, webpack and Babel are used, the goal here is to provide a simplified subset so most users don't have to worry about the underlying toolchain.
Getting Started
install this repository:
$ npm install --save-dev es6-transpiler-config
configure Babel in
package.json
¹:"babel": { "presets": ["es2015"] }
(cf.
samples/package.json
)create a
webpack.config.js
:let generateConfig = require("es6-transpiler-config"); module.exports = generateConfig("./src/index.js", "./dist/bundle.js");
(cf.
samples/webpack.config.js
)start transpiling:
$ webpack --progress --colors --watch
(cf. script commands in
samples/package.json
)
¹ While this might also be added to webpack's configuration, that would make it
difficult to use the same Babel configuration across different contexts (e.g.
by calling require("babel-register")
in tests to transpile on demand).