Skip to content

Instantly share code, notes, and snippets.

@WhereJuly
Created May 26, 2020 10:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WhereJuly/11e84eeb97992673932aa80cf53c6a5e to your computer and use it in GitHub Desktop.
Save WhereJuly/11e84eeb97992673932aa80cf53c6a5e to your computer and use it in GitHub Desktop.
Development environment live reload Gulp task for Adonis 4.1.0 full-stack project with Browsersync
// In fact can be used for every web project that needs live reload for dev environment.
// The accompanying guide is here:
// https://github.com/adonisjs/core/issues/1234#issuecomment-633937899
'use strict';
const gulp = require('gulp'),
browserSync = require('browser-sync').create();
const config = {
bsync: {
proxy: {
target: `http://127.0.0.1:3333`,
},
open: false,
files: [
`/app/**/*.*`,
`/config/**/*.*`,
`/database/**/*.*`,
`/public/**/*.*`,
`/resources/**/*.*`,
`/start/**/*.*`,
`/.env`
]
}
}
gulp.task('watch', function(done) {
browserSync.init(config.bsync);
done();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment