Skip to content

Latest commit

 

History

History
148 lines (110 loc) · 6.12 KB

File metadata and controls

148 lines (110 loc) · 6.12 KB

Build

People suck at repetitive tasks.

ESLint

Rollup and jsnext:main

Babel 6

Babel 6 relies on plugins. There are 2 types of plugins: syntax and transform.You use presets to consume plugins. Each preset comes with a set of plugins so you don't have to wire them up separately.

Make?

package.json

Component vs Bower

Bower is meant to work with build tools rather than replace them. Bower is not built with opinions on scripting loader or modular loading. It is not concerned with how the assets it manages get included in your web pages.

Glob

  • !name - Matches any single character not in name
  • {s1, s2, s3} - Matches any of the strings given (separated by commas)

Browser Sync

Gulp

Gulp has built-in watcher. Grunt uses JSON-like data configuration files; Gulp uses leaner, simpler JavaScript code.

gulp.src(glob)   /* Returns a readable stream */
gulp.dist(glob)  /* Returns a writable stream */

// 1 read and 2 writes
gulp.task('build-stuff', function() {
  return gulp.src('js/**/*.js')
    .pipe(concat('all.js'))
    .pipe(gulp.dest('build'))
    .pipe(uglify())
    .pipe(rename('all.min.js'))
    .pipe(gulp.dest('build'))
});

Plugins

Grunt

No context between transformations. More tasks, more slow-down. TMP file hell!

Plugins

Broccoli

JSHint

"maxparams": 4
"maxdepth": 4
"maxstatements": 20
"maxlen": 100
"maxcomplexity": 7