A
A
Acko2021-05-05 22:08:45
gulp.js
Acko, 2021-05-05 22:08:45

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);

I run gulp, instead of the contents of index.php, the structure of the working directory opens in the browser ...) I supplement the proxy line: 'localhost/abyss.dev/app/index.php', the contents of the index are included in the monitor, but after editing the file, browsersync does not see it, I restart the browser with my hands, the changes become. Nuance: git bash fixes the changes. I suspect the error is probably in the proxy line. What do I need to write in it, how to do it right? Please understand.
Ps local server Abyss, win 10, google chrome browser.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question