E
E
Extramezz2016-06-16 12:14:56
JavaScript
Extramezz, 2016-06-16 12:14:56

How to create compressed files next to original ones in gulp?

Good afternoon!
Tell me how to implement the following algorithm on gulp?

  • I specify a path like /assets/js
  • Gulp takes all .js files in this path (and in all sub-sub-sub-infinite-sub-folders)
  • Minifies them and puts them in the same directory as the original file, but renaming them to .min.js

Type:
//Указал "/somedir/"

/somedir/somedir2/file.js -> /somedir/somedir2/file.min.js
/somedir/file.js -> /somedir/file.min.js
/somedir/papka1/papka2/papka3/file.js -> /somedir/papka1/papka2/papka3/file.min.js

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2016-06-16
@Extramezz

https://www.npmjs.com/package/gulp-rename

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question