forked from openspending/os-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
66 lines (56 loc) · 1.8 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
'use strict';
var path = require('path');
var gulp = require('gulp');
var concat = require('gulp-concat');
var minifyCss = require('gulp-minify-css');
var frontSrcDir = path.join(__dirname, '/app');
var frontAssetsDir = path.join(frontSrcDir, '/assets');
var frontStylesDir = path.join(frontSrcDir, '/styles');
var publicDir = path.join(__dirname, '/public');
var publicStylesDir = path.join(publicDir, '/styles');
var publicFontsDir = path.join(publicDir, '/fonts');
var publicAssetsDir = path.join(publicDir, '/assets');
var nodeModulesDir = path.join(__dirname, '/node_modules');
gulp.task('default', [
'styles',
'assets'
]);
gulp.task('styles', function() {
var files = [
path.join(nodeModulesDir, '/font-awesome/css/font-awesome.css'),
path.join(nodeModulesDir, '/os-mockups/assets/css/openspending.css'),
path.join(frontStylesDir, '/main.css'),
path.join(nodeModulesDir, '/angular/angular-csp.css')
];
return gulp.src(files)
.pipe(concat('os-admin.css'))
.pipe(minifyCss())
.pipe(gulp.dest(publicStylesDir));
});
gulp.task('assets', [
'assets.images',
'assets.favicon',
'assets.fonts'
]);
gulp.task('assets.images', function() {
return gulp.src([
path.join(frontAssetsDir, '/**/*'),
path.join(nodeModulesDir, '/os-mockups/assets/os-assets/**/*'),
path.join(nodeModulesDir, '/os-mockups/assets/img/**/*')
])
.pipe(gulp.dest(publicAssetsDir));
});
gulp.task('assets.favicon', function() {
return gulp.src([
path.join(nodeModulesDir, '/os-mockups/assets/favicon.ico')
])
.pipe(gulp.dest(publicDir));
});
gulp.task('assets.fonts', function() {
var files = [
path.join(nodeModulesDir, '/font-awesome/fonts/*'),
path.join(nodeModulesDir, '/os-mockups/assets/fonts/**/*')
];
return gulp.src(files)
.pipe(gulp.dest(publicFontsDir));
});