forked from BenjjinF/django-fontawesome-5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
48 lines (39 loc) · 1.13 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
const gulp = require('gulp')
const plumber = require('gulp-plumber')
const scss = require('gulp-scss')
const cssnano = require('cssnano')
const postcss = require('gulp-postcss')
const autoprefixer = require('autoprefixer')
const babel = require('gulp-babel')
const uglify = require('gulp-uglify')
gulp.task('css', () => {
const plugins = [
autoprefixer(),
cssnano()
]
return gulp.src('src/scss/django-fontawesome.scss')
.pipe(plumber())
.pipe(scss())
.pipe(postcss(plugins))
.pipe(gulp.dest('fontawesome_5/static/fontawesome_5/css/'))
})
gulp.task('js', () => {
return gulp.src('src/js/django-fontawesome.js')
.pipe(plumber())
.pipe(babel({
presets: ['@babel/env']
}))
.pipe(uglify())
.pipe(gulp.dest('fontawesome_5/static/fontawesome_5/js/'))
})
gulp.task('watch', () => {
gulp.watch('src/scss/**/*.scss', ['css'])
.on('change', event => {
console.log('File ' + event.type + ', running tasks...')
})
gulp.watch('src/js/**/*.js', ['js'])
.on('change', event => {
console.log('File ' + event.type + ', running tasks...')
})
})
gulp.task('build', ['css', 'js'])