|
|
@@ -1,3 +1,5 @@ |
|
|
|
var version = require("./package.json").version |
|
|
|
|
|
|
|
let gulp = require("gulp"); |
|
|
|
let browserSync = require("browser-sync").create(); |
|
|
|
let sass = require("gulp-sass"); |
|
|
@@ -12,6 +14,8 @@ var tsify = require("tsify"); |
|
|
|
var watchify = require("watchify"); |
|
|
|
var fancy_log = require("fancy-log"); |
|
|
|
|
|
|
|
const zip = require("gulp-zip") |
|
|
|
|
|
|
|
var paths = { |
|
|
|
pages: ["src/html/*.html"], |
|
|
|
css: ["src/css/*.css"], |
|
|
@@ -47,6 +51,16 @@ function watchedBundle() { |
|
|
|
.pipe(gulp.dest("dist")); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Uses version in package.json to create zip |
|
|
|
*/ |
|
|
|
function versionedZip() { |
|
|
|
return gulp.src("./dist/**") |
|
|
|
.pipe(zip(`${version}.zip`)) |
|
|
|
.pipe(gulp.dest(".")); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Non-injecting SASS |
|
|
|
gulp.task('sass-noninject', function() { |
|
|
|
return gulp.src("src/scss/*.scss") |
|
|
@@ -86,6 +100,9 @@ gulp.task("build", gulp.series( |
|
|
|
|
|
|
|
gulp.task("build-hs", gulp.parallel("copy-html", "sass")); |
|
|
|
|
|
|
|
// Zip dist/ - eg for building Docker images where node isn't installed |
|
|
|
gulp.task("zip", gulp.series("build", versionedZip)); |
|
|
|
|
|
|
|
// Static Server + compile ts + watch scss/html/css files |
|
|
|
gulp.task('serve', gulp.series("build-hs", watchedBundle, function() { |
|
|
|
|
|
|
|