forked from i-rocky/country-list-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
24 lines (23 loc) · 795 Bytes
/
gulpfile.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
let gulp = require('gulp');
let browserify = require('browserify');
let rename = require('gulp-rename');
let uglify = require('gulp-uglify-es').default;
let sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var streamify = require('gulp-streamify');
gulp.task('default', function() {
var b = browserify({
entries: './index.js',
debug: true,
});
return b.bundle()
.pipe(source('./index.js'))
.pipe(buffer())
.pipe(sourcemaps.init({loadmaps: true}))
.pipe(streamify(uglify()))
.on('error', console.log) // eslint-disable-line no-console
.pipe(rename('country.min.js'))
.pipe(sourcemaps.write())
.pipe(gulp.dest('./dist'));
});