-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgulpfile.js
38 lines (29 loc) · 1.21 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
const es = require('event-stream');
const gulp = require('gulp');
const rmrf = require('gulp-rimraf');
const lessc = require('gulp-less');
const rename = require('gulp-rename');
gulp.task('clean', [], function() {
return gulp.src("./build/*", { read: false }).pipe(rmrf());
});
gulp.task('build', ['clean'], function () {
const templates = gulp.src('templates/*.html')
.pipe(gulp.dest('./build'));
const css = gulp.src("less/main.less")
.pipe(lessc())
.pipe(rename('styles.css'))
.pipe(gulp.dest("./build/css"));
const js = gulp.src('src/*.js')
.pipe(gulp.dest('./build/js'));
const vendor = gulp.src(['node_modules/file-saver/FileSaver.min.js',
'node_modules/font-awesome/css/font-awesome.min.css',
'node_modules/tachyons/css/tachyons.min.css',
'node_modules/font-awesome/fonts/*' ],
{base: 'node_modules/'})
.pipe(gulp.dest('./build/vendor/node_modules'));
const elmApp = gulp.src('bundle/elm-app.js')
.pipe(gulp.dest('./build/js'));
const avro = gulp.src('bundle/avro.js')
.pipe(gulp.dest('./build/vendor'));
return es.merge(templates, css, js, vendor, elmApp, avro);
});