-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
38 lines (32 loc) · 996 Bytes
/
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
const gulp = require("gulp");
const rename = require("gulp-rename");
const webpack = require("webpack-stream");
gulp.task('javascript', function() {
return gulp
.src("./hip/static/js/webpack_entry.js")
.pipe(webpack(require("./webpack.config.js")))
.pipe(rename("main.js"))
.pipe(gulp.dest("./hip/static/js/bundles/"));
});
gulp.task('watch-js', function(done) {
gulp.watch(["./hip/static/js/*.js"], gulp.series("javascript"));
done();
})
gulp.task('styles', function() {
const sass = require('gulp-sass')(require('sass'));
return gulp
.src("./hip/static/styles/bundle.scss")
.pipe(sass().on('error', sass.logError))
.pipe(rename("main.css"))
.pipe(gulp.dest("./static/styles/"));
});
gulp.task('watch-css', function(done) {
gulp.watch(
[
'./hip/static/styles/bundle.scss',
'./hip/static/styles/**/*.scss'
], gulp.series('styles')
);
done();
});
exports.default = gulp.series('styles', 'javascript', 'watch-css', 'watch-js');