This repository has been archived by the owner on Mar 3, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
138 lines (128 loc) · 2.99 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
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
132
133
134
135
136
137
138
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
jade: {
dev: {
options: {
pretty: true
},
files: {
'build/index.html': 'src/index.jade'
}
}
}
coffee: {
dev: {
files: [
{
expand: true
cwd: 'src/'
src: ['dist/*.coffee']
dest: 'build/'
filter: 'isFile'
ext: '.js'
}
]
}
build: {
options: {
bare: false
join: true
},
files: {
'temp/dist/dashboard.min.js': 'src/dist/*.coffee'
}
}
}
cssmin: {
build: {
options:
shorthandCompacting: false
roundingPrecision: -1
files: 'temp/css/dashboard.min.css': 'src/css/*'
}
}
uglify:
build: {
options: {
beautify: false
mangle: false
}
files: {
#'temp/dist/dashboard.min.js': 'temp/dist/dashboard.js'
# 'temp/libs/lodash.v3.min.js': 'temp/libs/lodash.v3.js'
}
}
clean:
dev: 'build/*'
build: ['temp/*', 'build/*', '!build/*.html']
copy:
dev: {
files: {
'build/libs/jquery.v2.1.min.js': 'node_modules/jquery/dist/jquery.min.js'
'build/libs/lodash.v3.js': 'node_modules/lodash/index.js'
'build/libs/taffydb.v2.7.min.js': 'node_modules/taffydb/taffy-min.js'
'build/css/pure-min.css': 'node_modules/purecss/build/pure-min.css'
'build/css/dashboard.css': 'src/css/dashboard.css'
'build/css/purecssLayout.css': 'src/css/purecssLayout.css'
'build/libs/chartist.v0.9.min.js': 'node_modules/chartist/dist/chartist.min.js'
'build/css/chartist.v0.9.min.css': 'node_modules/chartist/dist/chartist.min.css'
'build/CNAME': 'CNAME'
'build/README.md': 'README.md'
}
}
build:
files: [
{
expand: true
cwd: 'temp/'
src: ['css/*', '**/*.min.js']
dest: 'build/'
filter: 'isFile'
}
]
watch:
livereload:
options:
livereload: true
files: [
'src/**/*.{coffee,jade,css}'
]
tasks: [
'default'
]
connect: {
example: {
options: {
port: 4000,
base: ['build'],
livereload: true,
open: 'http://localhost:4000/index.html'
}
}
}
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks)
# Register tasks
grunt.registerTask 'develop', [
'default'
'connect'
'watch'
]
#grunt.registerTask 'server', [
# 'build'
# 'connect'
#]
#grunt.registerTask 'build', [
# 'clean:build'
# 'copy:build'
# 'cssmin'
# 'uglify'
#]
grunt.registerTask 'default', [
'clean:dev'
'copy:dev'
'jade'
'coffee:dev'
]
return