瀏覽代碼

v0.1.3 add 'gulp zip' command

tags/v0.1.3^0
bertieb 3 年之前
父節點
當前提交
90ff20ea7f
共有 2 個檔案被更改,包括 19 行新增1 行删除
  1. +17
    -0
      gulpfile.js
  2. +2
    -1
      package.json

+ 17
- 0
gulpfile.js 查看文件

@@ -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() {



+ 2
- 1
package.json 查看文件

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


Loading…
取消
儲存