-
Notifications
You must be signed in to change notification settings - Fork 111
/
Copy pathgulpfile.babel.js
53 lines (48 loc) · 1.35 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
52
53
const gulp = require('gulp');
const sourcemaps = require('gulp-sourcemaps');
const templateCache = require('gulp-angular-templatecache');
const concat = require('gulp-concat');
const addStream = require('add-stream');
const less = require('gulp-less');
const uglify = require('gulp-uglify');
const uglifycss = require('gulp-uglifycss');
const clean = require('gulp-clean');
const rollup = require('gulp-rollup');
const rollupBabel = require("rollup-plugin-babel");
const ngAnnotate = require('gulp-ng-annotate');
const cleanTask = () =>
gulp.src('build/*', {
read: false
})
.pipe(clean());
const lessTask = () =>
gulp.src('src/cron-gen.less')
.pipe(less())
.pipe(uglifycss())
.pipe(concat('cron-gen.min.css'))
.pipe(gulp.dest('build'));
const srcTask = () =>
gulp.src('src/**/*.js')
.pipe(sourcemaps.init())
.pipe(rollup({
output: {
format: 'iife'
},
plugins: [
rollupBabel()
],
input: 'src/cron-gen.module.js'
}))
.pipe(ngAnnotate())
.pipe(addStream.obj(() => gulp.src('src/templates/*.html')
.pipe(templateCache({
root: 'angular-cron-gen',
module: 'angular-cron-gen'
}))))
.pipe(gulp.dest('build'))
.pipe(concat('cron-gen.min.js'))
.pipe(uglify())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('build'));
const build = gulp.series(cleanTask, srcTask, lessTask);
export default build;