forked from frederickf/presentable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
121 lines (115 loc) · 4.27 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
ssh: grunt.file.readJSON('ssh.json'),
concat: {
options: {
banner: '<%= grunt.file.read("LICENSE") %>'
},
license: {
files: {
'dist/presentable.min.css': 'dist/presentable.min.css',
'dist/presentable.min.js': 'dist/presentable.min.js'
}
}
},
copy: {
icons: {expand: true, cwd: 'src/', src: ['icons/**'], dest: 'dist/'},
documentation: {
options: {
noProcess: ['**/*.{png,gif,jpg,jpegico,psd}'],
process: function (content, srcPath) {
//return content.replace(/..\/..\/dist\//g, "../../presentable/");
return content.replace(/..\/..\/dist\//g, "../../presentable/");
}
},
files: [
{expand: true, cwd: 'dist/', src: ['**'], dest: 'documentation/presentable/'},
{expand: true, cwd: 'presentations/html5slides/', src: ['index-r21.html'], dest: 'documentation/supported-frameworks/html5slides/', rename: function(dest, src) {
return dest + 'index.html';
}},
{expand: true, cwd: 'presentations/impress.js-0.5.3/', src: ['**'], dest: 'documentation/supported-frameworks/impress.js/'},
{expand: true, cwd: 'presentations/', src: ['io-2012-slides/**'], dest: 'documentation/supported-frameworks/'},
{expand: true, cwd: 'presentations/shower-20131018-template/', src: ['**'], dest: 'documentation/supported-frameworks/shower/'},
{expand: true, cwd: 'presentations/reveal.js-2.6.1/', src: ['**'], dest: 'documentation/supported-frameworks/reveal.js/'}
]
}
},
cssmin: {
minify: {
expand: true,
cwd: 'src/',
src: ['*.css', '!*.min.css'],
dest: 'dist/',
ext: '.min.css'
}
},
jshint: {
options: {
browser: true,
camelcase: true,
curly: true,
eqeqeq: true,
eqnull: true,
globals: {
console: true,
define: true,
require: true,
requirejs: true
},
indent: 4,
latedef: true,
newcap: true,
undef: true,
unused: true
},
src: 'src/*.js'
},
requirejs: {
js: {
options: {
name: 'main',
baseUrl: 'src',
wrap: {
start: '(function(window, document) {',
end: '}(window, document) );'
},
//optimize: 'none',
mainConfigFile: 'src/requireConfig.js',
out: 'dist/presentable.min.js',
skipModuleInsertion: true,
onBuildWrite: function( name, path, contents ) {
return require('amdclean').clean(contents);
}
}
}
},
rsync: {
options: {
args: ['-r', '-a', '-vv'],
syncDest: true,
ssh: true
},
publishDocumentation: {
options: {
src: "./documentation/",
dest: '<%= ssh.dest %>',
port: '<%= ssh.port %>'
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks("grunt-rsync");
grunt.registerTask("build", [
'copy:icons',
'cssmin:minify',
'jshint:src',
'requirejs:js',
'concat:license'
]);
};