-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathgulpfile.js
34 lines (32 loc) · 847 Bytes
/
gulpfile.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
var gulp = require('gulp');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var wrap = require('gulp-wrap-umd');
var del = require('del');
gulp.task('build', function(){
return gulp.src([
'src/yaml.js',
'src/md.js',
'src/util.js',
'src/actions.js',
'src/SelectionManager.js',
'src/UndoManager.js',
'src/Editor.js'
])
.pipe(concat('mdedit.js'))
.pipe(wrap({
namespace: 'mdEdit',
deps: [
{ name: 'prismjs', paramName: 'Prism', globalName: 'Prism', amdName: 'prismjs' }
],
exports: 'Editor'
}))
.pipe(gulp.dest('./'))
.pipe(rename({ suffix: '.min' }))
.pipe(uglify())
.pipe(gulp.dest('./'));
});
gulp.task('clean', function(cb) {
del(['mdedit.js', 'mdedit.min.js'], cb);
});