You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, if you use Apache virtual hosts, you will add these lines to whichever virtual host container(s) you want to have the script load for (that is, for every site you want to monitor). For example:
Make gulpfile.js like this (you can modified as you need):
var gulp = require('gulp'),
livereload = require('gulp-livereload'),
open = require('gulp-open');
/* Watch
================================= */
gulp.task('html', function () {
gulp.src('/path/to/file/**/*.html').pipe(livereload({ start: true }));
});
gulp.task('css', function () {
gulp.src('/path/to/file/**/*.css').pipe(livereload({ start: true }));
});
gulp.task('js', function () {
gulp.src('/path/to/file/**/*.js').pipe(livereload({ start: true }));
});
gulp.task('php', function () {
gulp.src('/path/to/file/**/*.php').pipe(livereload({ start: true }));
});
gulp.task('watch', function(){
livereload.listen();
gulp.watch(['/path/to/file/**/*.html'],['html']);
gulp.watch(['/path/to/file/**/*.css'],['css']);
gulp.watch(['/path/to/file/**/*.js'],['js']);
gulp.watch(['/path/to/file/**/*.php'],['php']);
});
/* Open Browser
================================= */
gulp.task('uri', function(){
gulp.src(__filename)
.pipe(open({uri: 'http://localhost/index.html'}));
});
/* you can use localhost or ip address
================================= */
gulp.task('serve', [ 'watch', 'uri' ]);
gulp.task('default', [ 'serve']);
restart apache
run gulp ---> from project directory
that is it and work for me.
The text was updated successfully, but these errors were encountered:
israndi
changed the title
gulp-livereload working with apache 2.4 web server
gulp-livereload working with apache 2.4 web server (PHP HTML CSS JS)
Oct 28, 2016
gulp-livereload working with apache 2.4 web server (PHP HTML CSS JS)
@apache Config:
reference http://feedback.livereload.com/knowledgebase/articles/86180-how-do-i-add-the-script-tag-manually-
and auto insert script by apache web server to modified tag html, http://httpd.apache.org/docs/2.4/mod/mod_substitute.html http://httpd.apache.org/docs/2.4/mod/mod_filter.html
If your web site is running on another server, you need to specify the IP address of your local computer instead:
However, if you use Apache virtual hosts, you will add these lines to whichever virtual host container(s) you want to have the script load for (that is, for every site you want to monitor). For example:
@node.js and npm at project directory:
that is it and work for me.
The text was updated successfully, but these errors were encountered: