1.2.3 • Published 6 years ago

gulp-split-files v1.2.3

Weekly downloads
73
License
MIT
Repository
github
Last release
6 years ago

gulp-split-files

A gulp plugin for manually splitting a set of files into even more files.

Use

superMegaBigCss.css content:

[lots of css stuff]
/*split*/
[lots more css stuff]
/*split*/
[even more css stuff]

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 produce three files:

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

Name the new files

/*splitfilename=first.css*/
[lots of css stuff]
/*split*/
/*splitfilename=second.css*/
[lots more css stuff]

This will produce two files:

  • first.css
  • second.css
/*splitfilename=first.css*/
[lots of css stuff]
/*split*/
[lots more css stuff]
/*split*/
/*splitfilename=third.css*/
[even more css stuff]

This will produce three files:

  • first.css
  • superMegaBigCss-1.css
  • third.css