-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgulpfile.js
131 lines (122 loc) · 2.82 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/*
+++++++++++++++++++++++++++++++++++++++++++++++++++++
title Project Gulp File +
project lumio +
repository https://github.com/arcticicestudio/lumio +
author Arctic Ice Studio +
email development@arcticicestudio.com +
copyright Copyright (C) 2016 +
+++++++++++++++++++++++++++++++++++++++++++++++++++++
[References]
Gulp
(http://gulpjs.com)
npmjs
(https://www.npmjs.com)
*/
"use strict";
/*+---------------+
+ Configuration +
+---------------+*/
var config = {
project: {
id: "lumio",
name: "Lumio",
version: "2.0.0",
repository: "https://github.com/arcticicestudio/lumio",
author: "Arctic Ice Studio",
email: "development@arcticicestudio.com"
},
build: {
base: "./build",
css: "./build/css",
sassdoc: "./build/documentation/sassdoc"
},
src: {
sass: "./src/sass"
},
tasks: {
compilation: {
sass: {
extensions: {
input: ["scss"],
output: "css"
},
options: {
indentedSyntax: false,
indentType: "space",
indentWidth: 2,
linefeed: "lf",
outputStyle: "expanded",
precision: 5,
sourceComments: false
}
}
}
}
}
/*+---------+
+ Imports +
+---------+*/
var del = require("del");
var fs = require("fs");
var gulp = require("gulp-help")(require("gulp"));
var gulputil = require("gulp-util");
var path = require("path");
var plumber = require("gulp-plumber");
var rename = require("gulp-rename");
var sass = require("gulp-sass");
var sassdoc = require("sassdoc");
/*+-------+
+ Tasks +
+-------+*/
/**
* Cleans the whole build folder.
*
* @since 2.0.0
*/
gulp.task("clean", function() {
del(config.build.base);
});
/**
* Cleans the CSS build folder.
*
* @since 2.0.0
*/
gulp.task("clean-css", function(){
del(config.build.css);
});
/**
* Cleans the documentation build folder.
*
* @since 2.0.0
*/
gulp.task("clean-documentation", function(){
del(config.build.sassdoc);
});
/**
* Compiles the Sass CSS template.
*
* @since 2.0.0
*/
gulp.task("compile-css-template", function() {
return gulp.src(path.join(config.src.sass, "/template-css." + config.tasks.compilation.sass.extensions.input))
.pipe(plumber())
.pipe(sass(config.tasks.compilation.sass.options).on("error", sass.logError))
.pipe(rename("/lumio." + config.tasks.compilation.sass.extensions.output))
.pipe(gulp.dest(config.build.css))
});
/**
* Shows the help.
*
* @since 2.0.0
*/
gulp.task("default", ["help"]);
/**
* Creates the Sassdoc documentation.
*
* @since 2.0.0
*/
gulp.task("sassdoc", function () {
return gulp.src(path.join(config.src.sass, "/**/*." + config.tasks.compilation.sass.extensions.input))
.pipe(sassdoc())
});