-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
31 lines (26 loc) · 824 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
25
26
27
28
29
30
31
'use strict';
var browserify = require('browserify');
var gulp = require('gulp');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
// Plugins
var uglify = require('gulp-uglify');
var sourcemaps = require('gulp-sourcemaps');
gulp.task('browserify', function() {
var bundler = browserify({
entries: ['./src/client/app/app.module.js'],
debug: true
});
var bundle = function() {
return bundler
.bundle()
.pipe(source('bundle.js'))
.pipe(buffer())
.pipe(sourcemaps.init({loadMaps: true}))
// Add transformation tasks to the pipeline here.
.pipe(uglify())
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./src/client/deploy'));
};
return bundle();
});