-
Notifications
You must be signed in to change notification settings - Fork 37
/
GruntFile.js
95 lines (85 loc) · 1.89 KB
/
GruntFile.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
const sass = require("node-sass");
module.exports = grunt => {
require("load-grunt-tasks")(grunt);
grunt.initConfig({
clean: ["dist"],
copy: {
src_to_dist: {
cwd: "src",
expand: true,
src: ["**/*", "!**/*.ts", "!**/*.js", "!**/*.scss", "!img/**/*"],
dest: "dist"
},
pluginDef: {
expand: true,
src: ["README.md", "CHANGELOG.md"],
dest: "dist"
},
img_to_dist: {
cwd: "src",
expand: true,
src: ["img/**/*"],
dest: "dist/src/"
},
logo_to_dist: {
cwd: "src",
expand: true,
src: ["img/logo.png"],
dest: "dist/"
}
},
watch: {
rebuild_all: {
files: ["src/**/*", "README.md", "CHANGELOG.md"],
tasks: [
"ts:default",
"sass:build",
"copy:src_to_dist",
"copy:pluginDef",
"copy:img_to_dist"
],
options: {
spawn: false
}
}
},
sass: {
build: {
options: {
debugInfo: true,
check: true,
implementation: sass,
sourceMap: false
},
files: {
"dist/css/default.dark.css": "src/css/default.dark.scss",
"dist/css/default.light.css": "src/css/default.light.scss"
}
}
},
tslint: {
options: {
configuration: "tslint.json"
},
files: {
src: ["src/**/*.ts"]
}
},
ts: {
default: {
tsconfig: "./tsconfig.json"
}
}
});
grunt.registerTask("test", ["run:tests", "tslint"]);
grunt.registerTask("default", [
"clean",
"tslint",
"ts:default",
"sass:build",
"copy:src_to_dist",
"copy:pluginDef",
"copy:img_to_dist",
"copy:logo_to_dist"
]);
};