Mohd Sayeed Mohd Sayeed - 5 months ago 80
PHP Question

How can integrate gulpjs in CakePhp 2.x ?

I want to integrate gulpjs into Php Framework (CakePhp 2.x), what would be best practice to use gulp to achieve following feature in CakePhp:

  • Minification of CSS, JavaScript, and images.

  • Automatically reload the browser after change.

  • Sass Compilation

    Note: I am new in gulpjs, please suggest use cases of gulpjs in Cakephp 2.x.


install Nodejs

install Npm

install gulp globally. npm install --global gulp-cli

create a package.json file in your root directory.

navigate to your project directory from terminal : npm install --save-dev gulp-install

Create a gulpfile.js at the root of your project.

var gulp = require('gulp'); gulp.task('default', function() {// place code for your default task here });

Run gulp from terminal gulp

Now you have gulp installation in your project. you can refer here for saas and gulp task.

Similarly you can find minify and other plugins from

There is good video tutorial to get you started.