mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-17 03:04:07 +01:00
Refactor code of gulp scripts
This commit is contained in:
@@ -6,29 +6,29 @@ 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/'))
|
||||
.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/'))
|
||||
.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'])
|
||||
|
||||
Reference in New Issue
Block a user