Skip to content

Instantly share code, notes, and snippets.

@fatrex
Last active February 25, 2017 10:56
Show Gist options
  • Select an option

  • Save fatrex/ea3c8fe7ab9867e71e22 to your computer and use it in GitHub Desktop.

Select an option

Save fatrex/ea3c8fe7ab9867e71e22 to your computer and use it in GitHub Desktop.
Gulp for Symfony 2
var gulp = require('gulp');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
var shell = require('gulp-shell');
gulp.task('serve', ['dump'], function() {
browserSync({
proxy: "local.symfony.domain/app_dev.php"
});
gulp.watch("path/to/less/**/*.less", ['dump', reload]);
gulp.watch("path/to/js/**/*.js", ['dump', reload]);
gulp.watch("path/to/Controller/**/*.php").on('change', reload);
gulp.watch("path/to/views/**/*.html.twig").on('change', reload);
});
gulp.task('dump', shell.task([
'touch path/to/main/less/file.less'
]))
gulp.task('default', ['serve']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment