-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathgulpfile.js
More file actions
46 lines (39 loc) · 1.22 KB
/
gulpfile.js
File metadata and controls
46 lines (39 loc) · 1.22 KB
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
(function() {
"use strict";
const path = require('path');
const rename = require('gulp-rename');
const gulp = require('gulp');
const concat = require('gulp-concat');
const uglify = require('gulp-uglify');
const sourcemaps = require('gulp-sourcemaps');
const del = require('del');
const config = {
masterFileName : 'apex-session-timeout',
paths : {
outputdir:'dist',
builddir:'build',
scripts: 'src/js/**/*.js',
plsql: 'src/plsql/**/*.{sql,pks,pkb}'
}
};
gulp.task('clean', function () {
return del([config.paths.builddir]);
});
gulp.task('scripts', ['clean'], function () {
return gulp.src(config.paths.scripts)
.pipe(gulp.dest(path.join(config.paths.outputdir, 'js')))
.pipe(sourcemaps.init())
.pipe(uglify())
.pipe(rename({suffix:'.min'}))
.pipe(sourcemaps.write('./maps'))
.pipe(gulp.dest(path.join(config.paths.outputdir, 'js')));
});
gulp.task('plsql',function(){
return gulp.src(config.paths.plsql)
.pipe(gulp.dest(path.join(config.paths.outputdir, 'plsql')))
});
gulp.task('watch', function () {
gulp.watch(config.paths.scripts, ['scripts']);
});
gulp.task('default', ['plsql','watch','scripts']);
})();