-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulpfile.js
42 lines (34 loc) · 1.53 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
const gulp = require("gulp");
const concat = require('gulp-concat');
const uglify = require('gulp-uglify');
gulp.task('concat-component-versions', () => {
return gulp.src('./site/imported_json/component_versions/*.json')
.pipe(concat('componentVersionPartial.txt', { newLine: ',' }))
.pipe(gulp.dest('./site/array'));
});
gulp.task('concat-components', () => {
return gulp.src('./site/imported_json/components/*.json')
.pipe(concat('componentPartial.txt', { newLine: ',' }))
.pipe(gulp.dest('./site/array'));
});
gulp.task('array-component-versions', () => {
return gulp.src(['./site/array/start.txt', './site/array/componentVersionPartial.txt', './site/array/end.txt'], { allowEmpty: true })
.pipe(concat('component-versions.json'))
.pipe(gulp.dest('./site/_data'));
});
gulp.task('array-components', () => {
return gulp.src(['./site/array/start.txt', './site/array/componentPartial.txt', './site/array/end.txt'], { allowEmpty: true })
.pipe(concat('components.json'))
.pipe(gulp.dest('./site/_data'));
});
gulp.task('json-copy', () => {
return gulp.src(['./site/_data/*.json'])
.pipe(gulp.dest('./site/data'));
});
gulp.task('javascript', () => {
return gulp.src(['./site/scripts/clipboard.js', './site/scripts/codepen.js', './site/scripts/component.js'])
.pipe(concat('main.js'))
.pipe(uglify())
.pipe(gulp.dest('./site/scripts'));
});
gulp.task("default", gulp.series(["concat-component-versions", "array-component-versions", "concat-components", "array-components", "json-copy", "javascript"]));