-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
46 lines (39 loc) · 1.18 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
var gulp = require('gulp')
var { spawn } = require('child_process')
var sass = require('gulp-sass')
gulp.task('django:runserver', () => {
spawn('python3', ['manage.py', 'runserver', '0.0.0.0:8000'], {
stdio: 'inherit'
})
})
gulp.task('sass:build', () => {
gulp.src(['./node_modules/metrics-graphics/dist/metricsgraphics.css',
'./media/css/base.scss'])
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./static/css'))
})
gulp.task('sass:watch', () => {
gulp.watch('./media/css/*', ['sass:build'])
})
gulp.task('js:build', () => {
gulp.src(['./node_modules/jquery/dist/jquery.slim.min.js',
'./node_modules/bootstrap/dist/js/bootstrap.bundle.min.js',
'./node_modules/d3/build/d3.min.js',
'./node_modules/metrics-graphics/dist/metricsgraphics.min.js',
'./media/js/*.js'
])
.pipe(gulp.dest('./static/js'))
})
gulp.task('js:watch', () => {
gulp.watch('./media/js/*', ['js:build'])
})
gulp.task('build', () => {
gulp.start('sass:build')
gulp.start('js:build')
})
gulp.task('default', () => {
gulp.start('build')
gulp.start('django:runserver')
gulp.start('sass:watch')
gulp.start('js:watch')
})