Build tools

Charlike Mike Reagent edited this page Dec 27, 2016 · 6 revisions

Gulp usage

We do not recommend to use gulp/stream wrappers around rollup, because they can introduce unexpected issues. Use Rollup API directly.

var gulp = require('gulp');
var rollup = require('rollup').rollup;
var commonjs = require('rollup-plugin-commonjs');
var nodeResolve = require('rollup-plugin-node-resolve');

gulp.task('script', function () {
  return rollup({
    entry: 'src/js/main.js',
    plugins: [
      nodeResolve({ jsnext: true }),
      commonjs()
    ]
  }).then(function (bundle) {
    return bundle.write({
      format: 'iife',
      dest: 'dist/js/main.js'
    });
  });
});