A collection of default convention-based common tasks for modules using Babel.
> A complete set of Gulp tasks for creating modern Javascript modules
_Babelator is part of the Live Ecosystem :seedling:_
[![NPM Version][npm-image]][npm-url]
[![Linux Build][travis-image]][travis-url]
[![Test Coverage][coveralls-image]][coveralls-url]
Use Drum to create a new Babelator module.
``bash`
npm i -g drum
drum g babelator
`bash`
npm i -D babelator gulpjs/gulp.git#4.0
Add the following to your gulpfile.js:
`js`
var gulp = require('gulp')
require('babelator')(gulp)
You can now use: npm run gulp .
`bash`
npm run gulp
See Tasks.
Compile on file change.
`bash`
npm i
npm run gulp watch
TODO: This section should be a print out from running gulp help...
gulp build - Cleans dist, then compiles src -> dist. Suitable as npm prepublish script in package.json.
gulp watch - Watches for changes. Compiles src -> dist on file change. Only compiles changed files. Cleans on first run.
gulp test - Runs tests.
gulp test-transpiled - Runs transpiled tests. Faster.
gulp test-watch - Watches for changes, and compiles + runs transpiled tests.
gulp bootstrap - Boostraps a module. Modifies package.json, etc. Prompts for any file being overwritten.
We want to minimize the time spent waiting for npm installs. You should be able to create a new module and publish to npm super quick.
`bash
babelator, gulp 4.0, and babel for quicker installsgit clone https://github.com/vjpr/babelator.git && cd babelator && npm link
git clone https://github.com/gulpjs/gulp.git && git checkout -b 4.0 origin/4.0 && cd gulp && npm link
git clone https://github.com/babel/babel.git && cd babel && make build && cd packages/babel && npm link
cd ~/dev
mkdir
babelatorAnswer some questions...
gulp bootstrapAnswer some questions...
gulp watch # or gulp test-watch
gulp nodemonHack, hack, hack...
gulp bump
gulp publish # npm/bower deploy
gulp deploy # gh-pages, etc.
`
Use local npm module cache. E.g. npm_lazy.
`bash
npm i -g npm_lazy
npm_lazy --init > ~/npm_lazy.config.js
$3
If you have a slow startup make sure you put all your requires inside your tasks.
Even though modules are cached on first require, common requires like
lodash
may still be loaded twice depending on their version
and when they were installed. So to be safe, task-scope everything.npm3 will help fix this by deduping.
Run
gulp --require time-require --sorted x` to see whats taking so much time.As of 31 Oct, 2015 = 1s + 711 require()
[npm-image]: https://img.shields.io/npm/v/gulp-babel-tasks.svg
[npm-url]: https://npmjs.org/package/gulp-babel-tasks
[travis-image]: https://img.shields.io/travis/vjpr/gulp-babel-tasks/master.svg
[travis-url]: https://travis-ci.org/vjpr/gulp-babel-tasks
[coveralls-image]: https://img.shields.io/coveralls/vjpr/gulp-babel-tasks/master.svg
[coveralls-url]: https://coveralls.io/r/vjpr/gulp-babel-tasks?branch=master