Gulp task is not working and even not shows any error

108 Views Asked by At

I just started learning gulp here I had written the task and run after run the task nothing is changed in my CSS file vendor prefixes are not added. I'm trying to add vendor prefixes and compress my CSS files. Can anyone suggest me. Is there my directory path is correct what I'm doing wrong here? why it is not working. And I used the latest version 4.0.1

Editor check dir path and task enter image description here

enter image description here

1

There are 1 best solutions below

6
On

First argument of gulp.src() have to be glob pointing to file/files.

Explaining Globs

A glob is a string of literal and/or wildcard characters used to match filepaths. Globbing is the act of locating files on a filesystem using one or more globs.

So first argument of src() should look like:

  • ./assets/css/app.css (to match specific file)
  • ./assets/css/*.css (to match all files with ext .css in directory)
  • ./assets/css/**/*.css (to match all files with ext .css in
    directory with subdirectorys)
  • ./assets/css/**/* (to match all files)

Also it is not good idea to use same input and output directory. Because after first run of task your source file will be ruined.

Maybe better idea is to use structure similar to that:

project-home/
  ├── ...
  ├── src/
  │   ├── css/
  │   ├── js/
  │   ├── images/
  ├── assets/
  │   ├── css/
  │   ├── js/
  │   ├── images/