Answer the question
In order to leave comments, you need to log in
Gulp not seeing php index file on local server?
This is how the working directory on the local server looks like:
abyss.dev ↓
app ↓
css
js
img
index.php
gulpfile.js:
const { src, dest, parallel, series, watch } = require('gulp');
const browserSync = require('browser-sync').create();
const concat = require('gulp-concat');
const uglify = require('gulp-uglify-es').default;
function browsersync() {
browserSync.init({
proxy: 'localhost/abyss.dev/app/',
notify: false,
online: true
});
}
function scripts() {
return src([
'node_modules/jquery/dist/jquery.min.js',
'app/js/main.js'
])
.pipe(concat('./main.min.js'))
.pipe(uglify())
.pipe(dest('app/js/'))
.pipe(browserSync.stream())
}
function startwatch() {
watch('app/**/*.css').on('change', browserSync.reload);
watch(['app/**/*.js', '!./app/**/*.min.js'], scripts);
watch('app/**/*.php').on('change', browserSync.reload);
}
exports.browsersync = browsersync;
exports.scripts = scripts;
exports.default = parallel(scripts, browsersync, startwatch);
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