-
-
Notifications
You must be signed in to change notification settings - Fork 62
/
gulpfile.js
52 lines (48 loc) · 1.52 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
var gulp = require('gulp');
var file = require('gulp-file');
var jsonfile = require('jsonfile')
var replace = require('gulp-replace');
const sass = require('gulp-sass')(require('sass'));
gulp.task('demos', function () {
return gulp
.src('src/Demos/*/*Demo.tsx')
.pipe(replace('../../lib', 'ka-table'))
.pipe(gulp.dest('public/demos'))
.pipe(gulp.dest('build/demos'));
});
gulp.task('compile', function () {
return gulp
.src([
'README.md',
'LICENSE',
])
.pipe(gulp.dest('dist'))
.on('end', () => {
var pkg = require('./package.json');
delete pkg.dependencies;
delete pkg.devDependencies;
delete pkg.scripts;
delete pkg.husky;
delete pkg.jest;
delete pkg.browserslist;
delete pkg.eslintConfig;
var outputFile = 'dist/package.json';
file(outputFile, '');
jsonfile.writeFile('dist/package.json', pkg, { spaces: 2 });
gulp
.src([
'src/lib/**/*.scss'
])
.pipe(gulp.dest('dist'))
.on('end', () => {
gulp.src('dist/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('dist'));
});
gulp
.src([
'src/lib/static/*'
])
.pipe(gulp.dest('dist/static'))
});
});