forked from nfqakademija/mad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGulpfile.js
49 lines (41 loc) · 1.24 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
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
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('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/**'
])
.pipe(gulp.dest(dir.dist + 'fonts'));
});
gulp.task('default', ['sass', 'scripts', 'fonts', 'images']);