Created
May 26, 2020 10:44
-
-
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
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
// 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