-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathGruntfile.coffee
98 lines (86 loc) · 2.6 KB
/
Gruntfile.coffee
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
module.exports = (grunt) ->
# Constants
require('load-grunt-tasks')(grunt)
grunt.initConfig
jshint:
options:
jshintrc: '.jshintrc'
all: ['_src/js/docs.js','_src/js/sdk-version.js']
less:
development:
options:
dumpLineNumbers: 'comments'
files: [{
src: '_src/css/less/main.less'
dest: 'dist/css/main.css'
}]
production:
options:
yuicompress: true
files: [{
src: '_src/css/less/main.less'
dest: 'dist/css/main.css'
}]
useminPrepare:
html: [
'footer.html'
'header.html'
]
options:
dest: '.'
copy:
main:
files: [
# makes all src relative to cwd
{expand: true, cwd: '_src/image/', src: ['**'], dest: 'dist/image/'},
{expand: true, cwd: '_src/html/', src: ['**'], dest: '.'},
{expand: true, cwd: '_src/add-on/highlight/', src: ['highlight.js'], dest: 'dist/add-on/'},
{expand: true, cwd: '_src/add-on/jquery.plugin/jquery.bxslider/', src: ['jquery.bxslider.min.js'], dest: 'dist/add-on/'},
{expand: true, cwd: '_src/add-on/', src: ['html5.js'], dest: 'dist/add-on/'},
{expand: true, cwd: '_src/js/', src: ['sdk-version.js'], dest: 'dist/js/'}
]
back:
files :[
{expand: true, cwd: '.', src: ['*.html'], dest: '_includes'}
]
filerev:
options:
algorithm: 'md5'
length: 8
js:
src: ['dist/js/docs.js', 'dist/add-on/app.js']
css:
src: ['dist/css/main.css']
usemin:
html: [
'footer.html'
'header.html'
]
clean:[
'footer.html'
'header.html'
]
grunt.registerTask 'production', [
'copy:main'
'less:production'
'useminPrepare'
'jshint'
'concat'
'uglify'
'filerev'
'usemin'
'copy:back'
'clean'
]
grunt.registerTask 'default', [
'copy:main'
'less:development'
'useminPrepare'
'jshint'
'concat'
'uglify'
'filerev'
'usemin'
'copy:back'
'clean'
]