N
N
nikitakarpenko2018-06-11 11:01:03
JavaScript
nikitakarpenko, 2018-06-11 11:01:03

How to scatter uglify, minify js into directories?

There is a js folder and there are two more folders in it fold1, fold2 which also have js. How to build and minify js so that it is in different directories, that is, build in a new folder build/js/fold1 , build/js/fold2 but where the minified files will already be

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2018-06-11
@nikitakarpenko

https://gulpjs.com/
https://www.npmjs.com/package/gulp-uglify
https://www.youtube.com/watch?v=uPk6lQoTThE&list=P...
If you want to keep the sub-folders, you have to define the base in the options (2nd argument)
eg, to keep "assets/file.doc" in "dist/":

gulp.src(["assets/file.doc"], {base: "."})
        .pipe(gulp.dest("dist/"));

https://github.com/gulpjs/gulp/issues/151

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question