Does gulp have code separation for javascript files?

I am using gulp and I want to know if it has the ability to split code. Something similar to what is mentioned here in the website . I looked online, but did not see anything that was dedicated to this.

+6
source share
1 answer

I found this on the Internet gulp-split-files , I hope this answers your problem.

As you told the author in the documentation.

In your gulpfile:

const gulp = require("gulp"); const splitFiles = require("gulp-split-files"); gulp.task("split", function () { return gulp.src("superMegaBigCss.css") .pipe(splitFiles()) .pipe(gulp.dest("path/to/dest")); }); 

This will create three files:

 superMegaBigCss-0.css superMegaBigCss-1.css superMegaBigCss-2.css 

I do not think this package is very useful as it breaks the code where we put the comment /*split*/ .


Personally, I like to use webpack so much, now I use it in most of my projects, I think it looks like a butcher, where he chopped off files and linked it in different ways.

0
source

All Articles