This repository has been archived by the owner on Mar 27, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.babel.js
47 lines (40 loc) · 1.75 KB
/
gulpfile.babel.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import gulp from 'gulp'
import Preset from './src/preset'
import Clean from './src/clean'
import EsLint from './src/eslint'
import RollupEs from './src/rollupEs'
import RollupAmd from './src/rollupAmd'
import RollupCjs from './src/rollupCjs'
import RollupUmd from './src/rollupUmd'
import Aggregate from './src/aggregate'
import series from './src/util/series'
import parallel from './src/util/parallel'
import PublishBuild from './src/publishBuild'
import Prepublish from './src/prepublish'
// Let's eat our own dogfood and use our own recipes to generate our dist packages
const preset = Preset.nodeSrc()
// NOTE: it's overkill to generate all of these, but what the hell, it's a fair example.
// Create our `default` set of recipes as a combination of series tasks with as much parallelization as possible, creates the `default` and `default:watch`
const defaultRecipes = new Aggregate(gulp, 'default',
series(gulp,
new Clean(gulp, preset),
new EsLint(gulp, preset),
parallel(gulp,
new RollupEs(gulp, preset, {options: {dest: 'gulp-pipeline.es.js'}}),
new RollupAmd(gulp, preset, {options: {dest: 'gulp-pipeline.amd.js'}}),
new RollupCjs(gulp, preset, {options: {dest: 'gulp-pipeline.cjs.js'}}),
new RollupUmd(gulp, preset, {options: {dest: 'gulp-pipeline.umd.js', moduleName: 'gulpPipeline'}})
)
)
)
const defaultAlias = new Aggregate(gulp, 'defaultAlias', defaultRecipes) // just to make sure Aggregates with Aggregates are working.
//---------------
// Publish tasks
// `publish`, gives us a `publish:watch` as well if we so desire to use it
new Aggregate(gulp, 'publish',
series(gulp,
new Prepublish(gulp, preset), // gives us a quick exit, in case we didn't commit
defaultAlias,
new PublishBuild(gulp, preset)
)
)