How do you connect npm bags through gulp?



  • Maybe I'm not exactly asking the question. The point is: Using the gulp collector. Rigger plastic collects all js files in such a way as:

    //= jquery.js
    //= bootstrap.js
    //= ../../node_modules/bootstrap-select/dist/js/bootstrap-select.js
    

    But connecting js or cs files isn't quite convenient. Is there perhaps a better and convenient way to deal with this problem?

    Target code gulp-a:

    gulp.task('js:build', function () {
        gulp.src('src/js/main.js')
            .pipe(rigger())
            .pipe(gulp.dest('pages/js/'))
            .pipe(reload({stream: true}));
    });
    


  • You can point the way to all the files in the JS folder without specifying each file separately. In this example, I gather all the files in a single one. script.js and record the result public:

    gulp.task('js:build', function(){
        gulp.src('./js/**/*')
            .pipe(concat('script.js'))
            .pipe(gulp.dest('./public/'))
    });
    

Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2