forked from orfin/WellCommerce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGulpfile.js
65 lines (58 loc) · 2.04 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var uglifycss = require('gulp-uglifycss');
var concat = require('gulp-concat');
var less = require('gulp-less');
var sourcemaps = require('gulp-sourcemaps');
var order = require('gulp-order');
var merge = require('merge-stream');
var livereload = require('gulp-livereload');
var paths = {
admin: {
libs: [
'web/bundles/fosjsrouting/js/router.js',
'web/bundles/wellcommerceapp/js/libs/**',
'web/bundles/wellcommerceapp/js/core/plugin/*.js',
'web/bundles/wellcommerceapp/js/core/form/*.js',
'web/bundles/wellcommerceapp/js/core/language/*.js'
],
core: [
'web/bundles/wellcommerceapp/js/core/gf.js',
'web/bundles/wellcommerceapp/js/core/init.js'
],
css: [
'web/bundles/wellcommerceapp/css/admin.css'
]
}
};
gulp.task('admin-libs', function () {
return gulp.src(paths.admin.libs)
.pipe(concat('libs.min.js'))
.pipe(uglify())
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('src/WellCommerce/Bundle/AppBundle/Resources/public/js/compiled/'))
.pipe(livereload());
});
gulp.task('admin-core', function () {
return gulp.src(paths.admin.core)
.pipe(concat('core.min.js'))
.pipe(uglify())
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('src/WellCommerce/Bundle/AppBundle/Resources/public/js/compiled/'))
.pipe(livereload());
});
gulp.task('admin-css', function () {
return gulp.src(paths.admin.css)
.pipe(concat('admin.min.css'))
.pipe(uglifycss())
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('src/WellCommerce/Bundle/AppBundle/Resources/public/css/'))
.pipe(livereload());
});
gulp.task('watch', function() {
livereload.listen();
gulp.watch(paths.admin.libs, ['admin-libs']);
gulp.watch(paths.admin.css, ['admin-css']);
gulp.watch(paths.admin.js, ['admin-js']);
});
gulp.task('default', ['admin-libs', 'admin-core', 'admin-css']);