Answer the question
In order to leave comments, you need to log in
How to set up browserSync for the dev version of a php site running through docker?
There is a dev version of the site, the environment is raised via docker,
how to properly configure browserSync in Galp so that it refreshes the page when css changes?
a site with a running docker is available via test.dev
on the docker nginx, php71, mysql, memcash
for static html did this:
gulp.task('browser-sync', function() { // Создаем таск browser-sync
browserSync({ // Выполняем browserSync
server: {
baseDir: 'app'
},
notify: false
});
});
gulp.task('watch', ['browser-sync'], function() {
gulp.watch('app/**/*.css', browserSync.reload); // Наблюдение за css
var gulp = require('gulp'), // Подключаем Gulp
browserSync = require('browser-sync'),
connectPHP = require('gulp-connect-php');
gulp.task('php', function () {
connectPHP.server({base: './', keepalive: true, hostname: 'http://test.dev', port: 80, open: false});
});
gulp.task('browser-sync', function () { // Создаем таск browser-sync
browserSync({ //
proxy: "http://test.dev",
port: 80,
notify: true,
});
});
gulp.task('watch', ['browser-sync'], function () {
gulp.watch('web/**/*.css', browserSync.reload); // Наблюдение за css
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question