Browse Source

v0.1.3 add 'gulp zip' command

tags/v0.1.3^0
bertieb 3 years ago
parent
commit
90ff20ea7f
2 changed files with 19 additions and 1 deletions
  1. +17
    -0
      gulpfile.js
  2. +2
    -1
      package.json

+ 17
- 0
gulpfile.js View File

@@ -1,3 +1,5 @@
var version = require("./package.json").version

let gulp = require("gulp"); let gulp = require("gulp");
let browserSync = require("browser-sync").create(); let browserSync = require("browser-sync").create();
let sass = require("gulp-sass"); let sass = require("gulp-sass");
@@ -12,6 +14,8 @@ var tsify = require("tsify");
var watchify = require("watchify"); var watchify = require("watchify");
var fancy_log = require("fancy-log"); var fancy_log = require("fancy-log");


const zip = require("gulp-zip")

var paths = { var paths = {
pages: ["src/html/*.html"], pages: ["src/html/*.html"],
css: ["src/css/*.css"], css: ["src/css/*.css"],
@@ -47,6 +51,16 @@ function watchedBundle() {
.pipe(gulp.dest("dist")); .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 // Non-injecting SASS
gulp.task('sass-noninject', function() { gulp.task('sass-noninject', function() {
return gulp.src("src/scss/*.scss") return gulp.src("src/scss/*.scss")
@@ -86,6 +100,9 @@ gulp.task("build", gulp.series(


gulp.task("build-hs", gulp.parallel("copy-html", "sass")); 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 // Static Server + compile ts + watch scss/html/css files
gulp.task('serve', gulp.series("build-hs", watchedBundle, function() { gulp.task('serve', gulp.series("build-hs", watchedBundle, function() {




+ 2
- 1
package.json View File

@@ -1,6 +1,6 @@
{ {
"name": "asphodice", "name": "asphodice",
"version": "0.1.1",
"version": "0.1.3",
"description": "Dice roller for Asphodel. Includes statistical information", "description": "Dice roller for Asphodel. Includes statistical information",
"devDependencies": { "devDependencies": {
"@types/chai": "^4.2.14", "@types/chai": "^4.2.14",
@@ -14,6 +14,7 @@
"gulp": "^4.0.2", "gulp": "^4.0.2",
"gulp-sass": "^4.1.0", "gulp-sass": "^4.1.0",
"gulp-typescript": "^6.0.0-alpha.1", "gulp-typescript": "^6.0.0-alpha.1",
"gulp-zip": "^5.0.2",
"tsify": "^5.0.2", "tsify": "^5.0.2",
"vinyl-source-stream": "^2.0.0", "vinyl-source-stream": "^2.0.0",
"watchify": "^4.0.0" "watchify": "^4.0.0"


Loading…
Cancel
Save