Gulp-Webapp Running Browsersync and PHP

Gulp-webapp running BrowserSync and PHP

FWIW, I've got a quite simple and fair solution for that by placing the compiled .css file in the app/ root and moving /bower_dependencies folder inside the app/ folder.

For Sass, I only needed to change the path in the placeholder to <!-- build:css styles/main.css --> and change the dest in the styles task.

For the bower_components, I just edited bower_components in .bowerrc:

{
"directory": "app/bower_components"
}

and added this to the wiredep stream in gulpfile.js:

  fileTypes: {
scss: {
replace: {
scss: '@import "app/{{filePath}}";'
}
}
},

Gulp PHP with BrowserSync and a proxy server throwing error

There was a bad install of http-proxy and/or gulp-php-connect. I uninstalled them, cleared npm cache, and did a fresh install. Everything worked fine after that.

GULP 4 - Using browsersync with PHP prompts for download

It turns out I really am a noob when it comes to Gulp and BrowserSync.
The correct configuration is:

    gulp.task('browserSync', function() {
phpConnect.server({
base:'./build/',
hostname:'127.0.0.1'
}, function (){
browserSync.init({
proxy: "127.0.0.1:8000"
});
});
});

because I'm trying to use the PHP Development Server on port 8000 and BrowserSync as PROXY not as a SERVER. Dumb me.
I hope this will save some time to someone in the same situation.



Related Topics



Leave a reply



Submit