This repository has been archived by the owner on Jul 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
99 lines (82 loc) · 2.87 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var cssmin = require('gulp-cssmin');
var dir = {
assets: './src/AppBundle/Resources/',
dist: './web/',
npm: './node_modules/',
};
gulp.task('sass', function() {
gulp.src(dir.assets + 'style/main.scss')
.pipe(sass({ outputStyle: 'compressed' }).on('error', sass.logError))
.pipe(concat('style.css'))
.pipe(gulp.dest(dir.dist + 'css'));
});
gulp.task('scripts', function() {
gulp.src([
//Third party assets
dir.npm + 'jquery/dist/jquery.min.js',
dir.npm + 'bootstrap-sass/assets/javascripts/bootstrap.min.js',
// Main JS file
dir.assets + 'scripts/main.js'
])
.pipe(concat('script.js'))
.pipe(uglify())
.pipe(gulp.dest(dir.dist + 'js'));
});
gulp.task('jsmin', function() {
gulp.src(dir.assets + 'scripts/jquery.fullPage.js')
.pipe(uglify())
.pipe(concat('jquery.fullPage.min.js'))
.pipe(gulp.dest(dir.dist + 'js'));
gulp.src(dir.assets + 'scripts/fullPage.js')
.pipe(uglify())
.pipe(concat('fullPage.min.js'))
.pipe(gulp.dest(dir.dist + 'js'));
gulp.src(dir.assets + 'scripts/jquery-3.2.0.js')
.pipe(uglify())
.pipe(concat('jquery-3.2.0.min.js'))
.pipe(gulp.dest(dir.dist + 'js'));
gulp.src(dir.assets + 'scripts/Admin/script.js')
.pipe(uglify())
.pipe(concat('script.min.js'))
.pipe(gulp.dest(dir.dist + 'js/Admin'));
gulp.src(dir.assets + 'scripts/Admin/jquery-2.2.3.min.js')
.pipe(concat('jquery-2.2.3.min.js'))
.pipe(gulp.dest(dir.dist + 'js/Admin'));
});
gulp.task('images', function() {
gulp.src([
dir.assets + 'images/**'
])
.pipe(gulp.dest(dir.dist + 'images'));
});
gulp.task('fonts', function() {
gulp.src([
dir.npm + 'bootstrap-sass/assets/fonts/**',
dir.assets + 'fonts/**'
])
.pipe(gulp.dest(dir.dist + 'fonts'));
});
gulp.task('cssmin', function() {
gulp.src(dir.assets + 'style/jquery.fullPage.css')
.pipe(cssmin())
.pipe(concat('jquery.fullPage.min.css'))
.pipe(gulp.dest(dir.dist + 'css'));
gulp.src(dir.assets + 'style/fullPage.css')
.pipe(cssmin())
.pipe(concat('fullPage.min.css'))
.pipe(gulp.dest(dir.dist + 'css'));
gulp.src(dir.assets + 'style/Admin/AdminLTE.css')
.pipe(cssmin())
.pipe(concat('AdminLTE.min.css'))
.pipe(gulp.dest(dir.dist + 'css/Admin'));
gulp.src(dir.assets + 'style/Admin/skins/skin-blue.css')
.pipe(cssmin())
.pipe(concat('skin-blue.min.css'))
.pipe(gulp.dest(dir.dist + 'css/Admin/skins'));
});
gulp.task('default', ['sass', 'scripts', 'jsmin', 'cssmin', 'fonts', 'images']);