forked from mermaid-js/mermaid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathless.js
35 lines (31 loc) · 1.04 KB
/
less.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
var gulp = require('gulp');
var path = require('path');
var less = require('gulp-less');
var rename = require('gulp-rename');
var concat = require('gulp-concat');
gulp.task('editor-less', function () {
gulp.src(['./editor/css/editor.less'])
.pipe(less({
generateSourceMap: false, // default true
paths: [ path.join(__dirname, 'less', 'includes') ]
}))
.pipe(concat('editor.css'))
.pipe(gulp.dest('./editor/css/'));
});
gulp.task('mermaid-less', function () {
gulp.src(['./src/less/*/mermaid.less'])
.pipe(less({
generateSourceMap: false, // default true
paths: [ path.join(__dirname, 'less', 'includes') ]
}))
.pipe(rename(function (path) {
if(path.dirname === 'default'){
path.basename = 'mermaid';
}else{
path.basename = 'mermaid.' + path.dirname;
}
path.dirname = '';
}))
.pipe(gulp.dest('./dist/'));
});
gulp.task('less',['mermaid-less', 'editor-less']);