C
C
CreativeStory2019-07-22 12:24:09
JavaScript
CreativeStory, 2019-07-22 12:24:09

How to merge js files in gulp?

There is a single script file main.js
There are several files with functionality, for example fileOne.js and fileTwo.js
How can fileOne.js and fileTwo.js be combined so that when the main.js file is compiled, the code from the first and second files ends up in main.js ?
As with styles through the include, it is not possible to do this.
The gulpfile says:

// scripts
gulp.task('scripts',function() {
    return gulp.src('src/static/js/main.js')
        .pipe(gulp.dest('build/static/js'))
        .pipe(browserSync.reload({
            stream: true
        }))
})

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2019-07-22
@Casufi

https://www.youtube.com/watch?v=uPk6lQoTThE&list=P...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question