-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
29 lines (28 loc) · 893 Bytes
/
gulpfile.js
File metadata and controls
29 lines (28 loc) · 893 Bytes
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
const path = require('path')
const gulp = require('gulp')
const webpack = require('webpack-stream')
const gutil = require('gulp-util')
// const gzip = require('gulp-gzip')
const rename = require('gulp-rename')
const uglify = require('gulp-uglify')
const sourcemaps = require('gulp-sourcemaps')
const webpackConfig = require('./webpack.config.js')
gulp.task('build', (done) => {
// inprogress.js
webpack(Object.assign(webpackConfig, {
entry: path.resolve(__dirname, 'index.js'),
output: {
filename: 'inprogress.js',
library: 'InProgress',
libraryTarget: 'umd'
}
}))
.pipe(gulp.dest('dist'))
// inprogress.min.js + source map
.pipe(sourcemaps.init())
.pipe(uglify().on('error', gutil.log))
// .pipe(gzip()) // FIXME: Unexpected token
.pipe(rename('inprogress.min.js'))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('dist'))
})