-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.babel.js
36 lines (32 loc) · 1.18 KB
/
gulpfile.babel.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
var assert = require('assert');
var gulp = require('gulp');
var genv = require('./gulp-env');
var browserSync = require('browser-sync');
var childProcess = require('child_process');
// Insert subgulps here ===========>
require('./gulpfile.hitpoint2015.js');
require('./gulpfile.hitpoint2017.js');
require('./gulpfile.hitpoint2019.js');
// <================================
genv.verifyPrefixes();
genv.registerPkgBuildAliases(); // `foo:build` available as `foo`, etc.
genv.registerMetatask('watch'); // `watch` = foo:watch, bar:watch, quux:watch, etc.
genv.registerMetatask('build'); // `build` = foo:build, bar:build, quux:build, etc.
gulp.task('browsersync-server', function() {
return browserSync({
open: false,
port: 9001,
proxy: {
target: 'http://localhost:9002',
ws: true
}
});
});
gulp.task('django-server', function() {
return childProcess.spawn('/usr/bin/env', ['python', 'manage.py', 'runserver', '127.0.0.1:9002'], {
stdio: [null, process.stdout, process.stderr]
}).on("error", function(e) {
console.error("Unable to spawn Django server for you :(", e);
});
});
gulp.task('default', ['build', 'watch', 'browsersync-server', 'django-server']);