-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathgulpfile.babel.js
More file actions
37 lines (33 loc) · 889 Bytes
/
gulpfile.babel.js
File metadata and controls
37 lines (33 loc) · 889 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
30
31
32
33
34
35
36
37
const gulp = require('gulp');
const browserify = require('gulp-browserify');
const uglify = require('gulp-uglify');
const rename = require('gulp-rename');
const onError = function (err) {
gutil.beep();
console.log(err);
};
const buildFile = (done) => {
gulp.src('./src/index.js')
.pipe(
browserify({
insertGlobals: true,
}),
)
.pipe(rename('kennitala.js'))
.pipe(gulp.dest('./'));
done();
};
const buildMinified = (done) => {
gulp.src('./src/index.js')
.pipe(
browserify({
insertGlobals: true,
}),
)
.pipe(uglify())
.pipe(rename('kennitala.min.js'))
.pipe(gulp.dest('./'));
done();
};
gulp.task('default', gulp.parallel(buildMinified, buildFile));
gulp.task('build', gulp.parallel(buildMinified, buildFile));