forked from passbolt/passbolt_help
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
106 lines (100 loc) · 2.82 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
96
97
98
99
100
101
102
103
104
105
106
/**
* Gruntfile
* Provides tasks and commands to build and distribute the project
*
* @param grunt
* @copyright (c) 2017 Passbolt SARL
* @licence GNU Affero General Public License http://www.gnu.org/licenses/agpl-3.0.en.html
*/
module.exports = function(grunt) {
/**
* Path shortcuts
*/
var path = {
node_modules: 'node_modules/',
assets: 'assets/',
css: 'assets/css/',
images: 'assets/img/',
fonts: 'assets/fonts/'
};
/**
* Import package.json file content
*/
var pkg = grunt.file.readJSON('package.json');
/**
* Load and enable Tasks
*/
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.registerTask('default', ['styleguide-update']);
grunt.registerTask('styleguide-update', ['copy:styleguide']);
/**
* Main grunt tasks configuration
*/
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
/**
* Copy operations
*/
copy: {
// Copy styleguide elements
styleguide: {
files: [{
// Icons
nonull: true,
cwd: path.node_modules + 'passbolt-styleguide/src/img/logo',
src: ['logo.png', '[email protected]', 'logo.svg'],
dest: path.images + 'logo',
expand: true
}, {
// CSS files
cwd: path.node_modules + 'passbolt-styleguide/build/css',
src: ['help.min.css'],
dest: path.css,
expand: true
}, {
// Font files
cwd: path.node_modules + 'passbolt-styleguide/src/fonts',
src: '*',
dest: path.fonts,
expand: true
}, {
// Icon
cwd: path.node_modules + 'passbolt-styleguide/src/img/webroot',
src: 'favicon.ico',
dest: path.assets,
expand: true
}, {
// 3rd party logos
cwd: path.node_modules + 'passbolt-styleguide/src/img/third_party',
src: ['docker_small_h.png'],
dest: path.images + 'third_party',
expand: true
}, {
// 3rd party logos
cwd: path.node_modules + 'passbolt-styleguide/src/img/screenshots',
src: '*',
dest: path.images + 'screenshots',
expand: true
}, {
// Illustrations
cwd: path.node_modules + 'passbolt-styleguide/src/img/illustrations',
src: ['birds6_850.png'],
dest: path.images + 'illustrations',
expand: true
}, {
// Background
cwd: path.node_modules + 'passbolt-styleguide/src/img/background',
src: ['og_preview.jpg'],
dest: path.images + 'background',
expand: true
}, {
// Diagrams
cwd: path.node_modules + 'passbolt-styleguide/src/img/diagrams',
src: '*',
dest: path.images + 'diagrams',
expand: true
}]
}
}
});
};