Skip to content

Instantly share code, notes, and snippets.

@puggan
Created May 6, 2019 20:13
Show Gist options
  • Save puggan/580a74b90e3b897ead36ab8cb26bcee0 to your computer and use it in GitHub Desktop.
Save puggan/580a74b90e3b897ead36ab8cb26bcee0 to your computer and use it in GitHub Desktop.
echo 'body {color: pink}' > pink.less
echo "{}" > package.json
cat << HEREDOC > gulpfile.js
const gulp = require("gulp");
const plug = require("gulp-load-plugins")();
gulp.task("default", () => gulp
.src("pink.less")
.pipe(plug.sourcemaps.init())
.pipe(plug.less())
.pipe(plug.sourcemaps.write("./", {includeContent: false, sourceRoot: "a/"}))
.pipe(gulp.dest("b/"))
.pipe(plug.ignore.exclude("*.map"))
.pipe(plug.cssnano())
.pipe(plug.sourcemaps.write("./", {includeContent: false, sourceRoot: "c/"}))
.pipe(gulp.dest("d/"))
);
HEREDOC
npm install --save gulp@3 gulp-load-plugins gulp-sourcemaps gulp-less gulp-ignore gulp-cssnano
gulp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment