简体   繁体   中英

Gulp task is not working and even not shows any error

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 在此处输入图片说明

在此处输入图片说明

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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM