forked from gophish/gophish
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
88 lines (82 loc) · 2.73 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*
* gulpfile.js
*
* Description: The Gophish gulpfile
*/
var gulp = require('gulp'),
rename = require('gulp-rename'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify-es').default,
cleanCSS = require('gulp-clean-css'),
babel = require('gulp-babel'),
js_directory = 'static/js/src/',
css_directory = 'static/css/',
app_directory = js_directory + 'app/',
dest_js_directory = 'static/js/dist/',
dest_css_directory = 'static/css/dist/';
// vendorjs = function () {
// const pkg = require('./package.json');
// const libs = Object.keys(pkg.dependencies);
// return gulp.src(
// libs.map(function(lib) {
// return './node_modules/' + lib + '/**/*.js';
// })
// )
// .pipe(concat('vendor.js'))
// .pipe(rename({
// suffix: '.min'
// }))
// .pipe(uglify())
// .pipe(gulp.dest(dest_js_directory));
// }
scripts = function () {
// Gophish app files - non-ES6
return gulp.src([
app_directory + 'autocomplete.js',
app_directory + 'campaign_results.js',
app_directory + 'campaigns.js',
app_directory + 'dashboard.js',
app_directory + 'groups.js',
app_directory + 'landing_pages.js',
app_directory + 'sending_profiles.js',
app_directory + 'settings.js',
app_directory + 'templates.js',
app_directory + 'gophish.js',
app_directory + 'users.js',
app_directory + 'webhooks.js',
app_directory + 'passwords.js'
])
.pipe(rename({
suffix: '.min'
}))
.pipe(uglify().on('error', function (e) {
console.log(e);
}))
.pipe(gulp.dest(dest_js_directory + 'app/'));
}
styles = function () {
return gulp.src([
css_directory + 'bootstrap.min.css',
css_directory + 'main.css',
css_directory + 'dashboard.css',
css_directory + 'flat-ui.css',
css_directory + 'dataTables.bootstrap.css',
css_directory + 'font-awesome.min.css',
css_directory + 'chartist.min.css',
css_directory + 'bootstrap-datetime.css',
css_directory + 'checkbox.css',
css_directory + 'sweetalert2.min.css',
css_directory + 'select2.min.css',
css_directory + 'select2-bootstrap.min.css',
])
.pipe(cleanCSS({
compatibilty: 'ie9'
}))
.pipe(concat('gophish.css'))
.pipe(gulp.dest(dest_css_directory));
}
// exports.vendorjs = vendorjs
exports.scripts = scripts
exports.styles = styles
exports.build = gulp.parallel(scripts, styles)
exports.default = exports.build