-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulpfile.js
40 lines (33 loc) · 977 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
35
36
37
38
39
40
import del from 'del';
import path from 'path';
import gulp from 'gulp';
import eslint from 'gulp-eslint';
import babel from 'gulp-babel';
import writeFile from './build/write-file';
import { generateRoutes } from './src/routes/generate';
import './build/azure';
gulp.task('clean', ['azure:clean'], () =>
del(['dist']));
gulp.task('lint', () =>
gulp.src(['gulpfile.js', 'src/**/*.js', 'test/**/*.js'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failOnError()));
gulp.task('transform', ['clean'], () =>
gulp.src('src/**/*.js')
.pipe(babel())
.pipe(gulp.dest('dist')));
gulp.task('services', ['clean'], () =>
writeFile(
path.resolve(__dirname, './dist/services/configuration.json'),
'{}'));
gulp.task('routes', ['clean'], () =>
writeFile(
path.resolve(__dirname, './dist/routes/routes.json'),
JSON.stringify({ routes: generateRoutes() })));
gulp.task('build', [
'lint',
'routes',
'services',
'transform',
]);