-
-
Save robbintt/54e97da94e02fc3c8ac9 to your computer and use it in GitHub Desktop.
Django collectstatic + Gulp watch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
// Run shell commands with exec: | |
// https://www.npmjs.com/package/gulp-exec | |
var exec = require('child_process').exec; | |
// collectstatic task for Django | |
// https://www.npmjs.com/package/gulp-exec | |
gulp.task('collectstatic', function (cb) { | |
exec('python ../../manage.py collectstatic -i node_modules -i bower_components --noinput', function (err, stdout, stderr) { | |
console.log(stdout); | |
console.log(stderr); | |
cb(err); | |
}); | |
}); | |
// collectstatic should be added to the end of each watch command rather than initalizing alone. | |
//gulp.task('watch', function () { | |
// gulp.watch('static/**/*.*', ['collectstatic']); | |
//}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note gulp 4.x: Pass a
gulp.series()
invocation with only one task name.