mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
d61da879d8
mermaid_config can be used to config start on load.
60 lines
1.8 KiB
JavaScript
60 lines
1.8 KiB
JavaScript
var gulp = require('gulp');
|
|
var jison = require('gulp-jison');
|
|
var shell = require('gulp-shell');
|
|
var concat = require('gulp-concat');
|
|
var uglify = require('gulp-uglify');
|
|
var extReplace = require('gulp-ext-replace');
|
|
var rename = require('gulp-rename');
|
|
|
|
|
|
gulp.task('jison2', function() {
|
|
return gulp.src('./src/*.jison')
|
|
.pipe(jison({ moduleType: 'amd' }))
|
|
.pipe(gulp.dest('./src/'));
|
|
});
|
|
|
|
gulp.task('jison', shell.task([
|
|
'jison src/parser/flow.jison -o src/parser/flow.js'
|
|
//'source scripts/compileJison.sh'
|
|
// 'jison src/parser/flow.jison -o src/parser/flow.js',
|
|
]))
|
|
|
|
gulp.task('jisonSd', shell.task([
|
|
//'jison src/parser/flow.jison -o src/parser/flow.js',
|
|
'jison src/parser/sequence.jison -o src/parser/sequence.js'
|
|
//'source scripts/compileFlow.sh'
|
|
]));
|
|
|
|
gulp.task('dist', ['slimDist', 'fullDist']);
|
|
|
|
var jasmine = require('gulp-jasmine');
|
|
|
|
gulp.task('jasmine',['jison'], function () {
|
|
return gulp.src('src/parser/flow.spec.js')
|
|
.pipe(jasmine());
|
|
});
|
|
|
|
var browserify = require('gulp-browserify');
|
|
|
|
// Basic usage
|
|
gulp.task('slimDist', function() {
|
|
// Single entry point to browserify
|
|
return gulp.src('src/main.js')
|
|
.pipe(browserify())
|
|
.pipe(rename('mermaid.slim.js'))
|
|
.pipe(gulp.dest('./dist/'))
|
|
.pipe(uglify())
|
|
.pipe(extReplace('.min.js'))
|
|
.pipe(gulp.dest('./dist/'));
|
|
});
|
|
|
|
// Basic usage
|
|
gulp.task('fullDist', ['slimDist'], function() {
|
|
// Single entry point to browserify
|
|
gulp.src(['node_modules/d3/d3.min.js','node_modules/dagre-d3/dist/dagre-d3.min.js','dist/mermaid.slim.js'])
|
|
.pipe(concat('mermaid.full.js'))
|
|
.pipe(gulp.dest('./dist/'));
|
|
return gulp.src(['node_modules/d3/d3.min.js','node_modules/dagre-d3/dist/dagre-d3.min.js','dist/mermaid.slim.min.js'])
|
|
.pipe(concat('mermaid.full.min.js'))
|
|
.pipe(gulp.dest('./dist/'));
|
|
}); |