-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
44 lines (30 loc) · 925 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
41
42
43
44
// Requis
var gulp = require('gulp');
// Include plugins
var plugins = require('gulp-load-plugins')(); // tous les plugins de package.json
// Variables de chemins
var source = './src'; // dossier de travail
var destination = './dist'; // dossier à livrer
gulp.task('js', () =>
gulp.src(source + '/*.js')
.pipe(plugins.concat("jsonFormValidator.js"))
.pipe(plugins.babel({
"presets": ["env"]
}))
.pipe(plugins.uglify())
.pipe(gulp.dest(destination))
);
gulp.task('clean', () =>
gulp.src(destination)
.pipe(plugins.clean({force: true}))
)
// Tâche "watch" = je surveille *less
gulp.task('watch', function () {
gulp.watch(source + '/*.js', ['js']);
});
// Tâche "build"
gulp.task('build', ['clean', 'js']);
// Tâche "prod" = Build + minify
gulp.task('prod', ['build', 'minify']);
// Tâche par défaut
gulp.task('default', ['build', 'watch']);