-
Notifications
You must be signed in to change notification settings - Fork 29
/
gulpfile.js
62 lines (51 loc) · 1.97 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
const gulp = require('gulp');
const babel = require('gulp-babel');
const uglify = require('gulp-uglifyjs');
const rename = require('gulp-rename');
const runSequence = require('run-sequence');
const del = require('del');
gulp.task('default',['src','exports']);
gulp.task('src', () => {
return gulp.src('src/*.js')
.pipe(babel({
presets: ['es2015']
}))
// .pipe(rename('ag-grid-vue.js'))
.pipe(gulp.dest('dist/'));
// .pipe(uglify())
// .pipe(rename('ag-grid-vue.min.js'))
// .pipe(gulp.dest('dist'));
});
gulp.task('exports', () => {
return gulp.src('./exports.js')
.pipe(babel({
presets: ['es2015']
}))
.pipe(rename('main.js'))
.pipe(gulp.dest('./'));
});
gulp.task('clean-nm-ag-grid', () => {
return del(['node_modules/ag-grid', '!node_modules']);
});
gulp.task('clean-nm-ag-grid-enterprise', () => {
return del(['node_modules/ag-grid-enterprise', '!node_modules']);
});
gulp.task('copy-nm-dirs', (callback) => {
return runSequence('copy-from-ag-grid', 'copy-from-ag-grid-enterprise', 'copy-from-ag-grid-vue', callback);
});
gulp.task('copy-from-ag-grid', () => {
return gulp.src(['../ag-grid/*', '../ag-grid/dist/**/*'], {base: '../ag-grid'})
.pipe(gulp.dest('./node_modules/ag-grid'));
});
gulp.task('copy-from-ag-grid-enterprise', () => {
return gulp.src(['../ag-grid-enterprise/*', '../ag-grid-enterprise/dist/**/*'], {base: '../ag-grid-enterprise'})
.pipe(gulp.dest('./node_modules/ag-grid-enterprise'));
});
gulp.task('copy-nm-dirs', (callback) => {
return runSequence('copy-from-ag-grid', 'copy-from-ag-grid-enterprise', callback);
});
gulp.task('watch', ['copy-nm-dirs'], () => {
gulp.watch(['../ag-grid/dist/**/*', '../ag-grid/src/**/*'], ['copy-from-ag-grid']);
gulp.watch(['../ag-grid-enterprise/dist/**/*', '../ag-grid-enterprise/src/**/*'], ['copy-from-ag-grid-enterprise']);
gulp.watch(['./src/**/*','./dist/**/*'], ['default']);
});