Skip to content

Instantly share code, notes, and snippets.

@pligor
Last active August 29, 2015 14:22
Show Gist options
  • Save pligor/909fd2da35caa21b5fdb to your computer and use it in GitHub Desktop.
Save pligor/909fd2da35caa21b5fdb to your computer and use it in GitHub Desktop.
Basic gulp usage to get up and running with a very minimal gulp scenario
/**
* Created by pligor on 5/26/15.
*/
///<reference path="./declarations/node.d.ts"/>
///<reference path="./declarations/gulp.d.ts"/>
var gulp = require("gulp")
//var plugins = require('gulp-load-plugins')(); // Load all gulp plugins
// automatically and attach
// them to the `plugins` object
var runSequence = require('run-sequence'); // Temporary solution until gulp 4
// https://github.com/gulpjs/gulp/issues/355
var preprocess = require('gulp-preprocess');
var pkg = require('./package.json');
var dirs = pkg['h5bp-configs'].directories; //h5bp means html5 boiler plate
var htmlPath = dirs.src + "/index.html"
gulp.task("include_production_libraries", () => {
return gulp.src(htmlPath).pipe(
preprocess({
context: {
production: null //does not care of the value, just to define the element
}
})
).pipe(gulp.dest(dirs.dist))
})
gulp.task('copyallrest', () => {
return gulp.src([
dirs.src + '/**/*',
'!' + htmlPath,
]).pipe(gulp.dest(dirs.dist));
});
gulp.task("default", () => {
//nothing for now
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment