jgraph-3.8.0
use gulp compression
related codes
/ / Import toolkit
var gulp = require ("gulp"); / / place to install gulp locally
/ / var less = require (" gulp-less");
var cssmin = require ("gulp-minify-css"); / / compress css
/ / var autoprefixer = require (" gulp-autoprefixer"); / / automatically add browser prefix
var uglify = require ("gulp-uglify"); / / compress js file
var concat = require (" gulp-concat") / / merge all js files
/ / var watch = require ("gulp-watch");
var rename = require (" gulp-rename");
/ / prompt errors when an exception occurs to ensure local installation of gulp-notify and gulp-plumber
const notify = require ("gulp-notify");
const plumber = require (" gulp-plumber");
const gutil = require ("gulp-util");
/ Mapping
const sourcemaps = require (" gulp-sourcemaps")
gulp.task ("util", function () {
return gulp.src ([". / util/*.js"])
// .pipe(sourcemaps.init())
.pipe(concat("util.js"))
.pipe(uglify())
// .pipe(sourcemaps.write("."))
.pipe(gulp.dest("./util"))
});
gulp.task ("shape", function () {
return gulp.src ([". / shape/*.js"])
// .pipe(sourcemaps.init())
.pipe(concat("shape.js"))
.pipe(uglify())
// .pipe(sourcemaps.write("."))
.pipe(gulp.dest("./shape"))
});
gulp.task ("layout", function () {
return gulp.src ([". / layout/*.js"])
// .pipe(sourcemaps.init())
.pipe(concat("layout.js"))
.pipe(uglify())
// .pipe(sourcemaps.write("."))
.pipe(gulp.dest("./layout"))
});
gulp.task ("model", function () {
return gulp.src ([". / model/*.js"])
// .pipe(sourcemaps.init())
.pipe(concat("model.js"))
.pipe(uglify())
// .pipe(sourcemaps.write("."))
.pipe(gulp.dest("./model"))
});
gulp.task ("view", function () {
return gulp.src ([". / view/*.js"])
// .pipe(sourcemaps.init())
.pipe(concat("view.js"))
.pipe(uglify())
// .pipe(sourcemaps.write("."))
.pipe(gulp.dest("./view"))
});
gulp.task ("handler", function () {
return gulp.src ([". / handler/*.js"])
// .pipe(sourcemaps.init())
.pipe(concat("handler.js"))
.pipe(uglify())
// .pipe(sourcemaps.write("."))
.pipe(gulp.dest("./handler"))
});
gulp.task ("editor", function () {
return gulp.src ([". / editor/*.js"])
// .pipe(sourcemaps.init())
.pipe(concat("editor.js"))
.pipe(uglify())
// .pipe(sourcemaps.write("."))
.pipe(gulp.dest("./editor"))
});
gulp.task ("io", function () {
return gulp.src ([". / io/*.js"])
// .pipe(sourcemaps.init())
.pipe(concat("io.js"))
.pipe(uglify())
// .pipe(sourcemaps.write("."))
.pipe(gulp.dest("./io"))
});
/ / single directory merge
gulp.task ("minify", [" util","shape","layout","model","view","handler","editor","io"]);