Last active
August 29, 2015 14:22
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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