After successfully setting up yarn and getting the hang of how it functions, I've also started to grasp the basics of gulp. I was relieved to find out how to install version 4 and avoid those deprecated errors that came with the default version.
As of now, I've utilized yarn to install three packages which resulted in a plethora of dependencies being downloaded. While it's possible to use a gulp file to merge these dependencies into a single JavaScript file, the challenge lies in maintaining the integrity of the yarn dependencies as they are built up. How can I structure my gulp task to combine the yarn libraries I've integrated?
The current structure of my gulp task is as follows:
//Concatenate & Minify JS
gulp.task('scripts', function() {
return gulp.src('assets/javascript/*.js')
.pipe(concat('all.js'))
.pipe(gulp.dest('assets/dist'))
.pipe(rename('all.min.js'))
.pipe(uglify())
.pipe(gulp.dest('assets/dist/js'));
});
While this effectively concatenates my scripts, I am unsure of how to incorporate the yarn dependencies from the assets/node_modules folder. Since yarn manages dependencies to ensure proper installation, I wonder if simply adding them to the same file would suffice.
My command to run this task is yarn run watch
The packages I have added are: html5shiv, jquery, modernizr
What is the appropriate method to include the yarn files from assets/node_modules?