M
M
MRcracker2018-10-05 22:40:54
Building projects
MRcracker, 2018-10-05 22:40:54

How to make task compile js correctly?

Hello. I use gulp + browserSync. There was a problem when minifying js files using es6 and updating js files. When updating files, you have to constantly restart gulp, which is very inconvenient. Tell me how to write a tax that will automatically compress js and update the page. Thanks a lot

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Matvey Phoenix, 2018-10-05
@MRcracker

Here is an example of my build https://github.com/mtvphnx/gulp-start . There is a section for tracking changes and rebooting.
Watcher himself:

function watch() {
    gulp.watch('путь', 'таск');
}

With the start command, we start the assembly, after the assembly has passed, the watcher and the server are launched, if the watcher saw changes in the folder we are monitoring, the necessary task is performed, for example, to minify js.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question