> For the complete documentation index, see [llms.txt](https://javascriptuse.gitbook.io/javascript/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://javascriptuse.gitbook.io/javascript/gulp-developing-an-application-ok.md).

# \[GULP] Gulp - Developing An Application (ok)

https\://www\.tutorialspoint.com/gulp/gulp\_developing\_application.htm

> Chú ý: Để kết hợp được các task với nhau từ phiên bản 4.x trở đi chúng ta phải
>
> gulp.task('default', gulp.series('css','js'));
>
> Chú ý: Nếu thì sử dụng &#x20;
>
> ```
> gulp.task('default', gulp.series('a', 'b', 'c'));
> ```
>
> Thì sử dụng
>
> ```
> gulp.task('default', gulp.parallel('a', 'b', 'c'));
> ```

### Dependencies Declaration

```
npm install gulp-imagemin --save-dev
```

You can add dependencies to your configuration file as shown in the following code.

```
var imagemin = require('gulp-imagemin');
```

### Creating Task for Dependencies

```
gulp.task('task-name', function() {
   //do stuff here
});
```

Example

```
gulp.task('imagemin', function() {
   var img_src = 'src/images/**/*', img_dest = 'build/images';

   gulp.src(img_src)
   .pipe(changed(img_dest))
   .pipe(imagemin())
   .pipe(gulp.dest(img_dest));
});
```

### Running the Task

```
gulp imagemin
```
