-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.babel.js
51 lines (48 loc) · 1.4 KB
/
gulpfile.babel.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
import gulp from 'gulp';
import gtb from './gtb';
import pkg from './package.json';
import commonTasks from './gtb/common-tasks';
import serve from './gulp-tasks/serve';
var task = gtb();
// gtb implicitly outputs all the files to `dest` unless
// they have already been written with `put()`.
// Default value:
task.config({
dest: 'dist'
});
task.filesIn('app')
.withExtension('js')
.excluding(/^nobabel\//)
.run(commonTasks.babel({
presets: ['es2015'],
plugins: ['transform-es2015-modules-amd']
}))
.run(commonTasks.minifyJs());
task.filesIn('app')
.withExtension('js')
.matching(/^nobabel\//)
.run(commonTasks.minifyJs());
task.filesIn('app')
.withExtension('sass', 'scss')
.run(commonTasks.compileSass())
.run(commonTasks.autoprefixer())
.run(commonTasks.minifyCss());
task.filesIn('app')
.withExtension('css')
.run(commonTasks.autoprefixer())
.run(commonTasks.minifyCss());
task.filesIn('app')
.withExtension('html')
.run(commonTasks.replace('{{_!_version_!_}}', pkg.version))
.run(commonTasks.minifyHtml())
task.filesIn('app')
.withExtension('jpeg', 'jpg', 'png', 'svg')
.run(commonTasks.imagemin());
task.filesIn('bower_components')
.inFolder('moment/min')
.withName('moment.min.js')
.run(commonTasks.minifyJs())
.put('vendor/moment');
gulp.task('build', task.build());
gulp.task('default', gulp.series('build'));
gulp.task('serve', gulp.series('build', serve));