Created
January 4, 2016 19:24
-
-
Save dezoito/8ba32571315f6f0b0602 to your computer and use it in GitHub Desktop.
Super simple Django + BrowserSync Gulpfile
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
// Assuming you already have NodeJS, npm and gulp installed | |
// and followed instructions at: | |
// https://www.browsersync.io/docs/gulp/ | |
// | |
// save this file at <<DJANGO PROJECT ROOT>> | |
// on your terminal: | |
// $ cd <<DJANGO PROJECT ROOT>> | |
// $ gulp | |
// this will open a browser window with your project | |
// and reload it whenever a file with the extensions scss,css,html,py,js | |
// is changed | |
var gulp = require('gulp'); | |
var browserSync = require('browser-sync'); | |
var reload = browserSync.reload; | |
gulp.task('default', function() { | |
browserSync.init({ | |
notify: false, | |
proxy: "localhost:8000" | |
}); | |
gulp.watch(['./**/*.{scss,css,html,py,js}'], reload); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
with an actual install of gulp following line 23 needs to be replaced as follows:
gulp.watch(['./**/*.{scss,css,html,py,js}']).on('change', browserSync.reload);
line 16 can be deleted