forked from haas85/tako
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gruntfile.coffee
119 lines (103 loc) · 4.02 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
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON "package.json"
meta:
file : 'tako'
assets : "assets",
package : "package",
temp : "build",
banner : """
/* <%= pkg.name %> v<%= pkg.version %> - <%= grunt.template.today("m/d/yyyy") %>
<%= pkg.homepage %>
Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %> - Under <%= pkg.license %> License */
"""
# =========================================================================
source:
coffee: [
"src/**.coffee",
"src/elements/**.coffee",
"src/modules/**.coffee"
]
stylus:[
"stylesheets/Tako.base.styl",
"stylesheets/Tako.aside.styl",
"stylesheets/Tako.article.styl",
"stylesheets/Tako.lists.styl",
"stylesheets/Tako.forms.styl",
"stylesheets/Tako.layouts.styl",
"stylesheets/Tako.buttons.styl",
"stylesheets/Tako.pullrefresh.styl",
"stylesheets/Tako.notifications.styl",
"stylesheets/Tako.colors.styl",
"stylesheets/Tako.icons.styl",
"stylesheets/Tako.medias.styl"
]
theme: [
"stylesheets/Tako.theme.styl"
],
components: [
"components/zepto/zepto.js",
"components/zepto/detect.js",
"components/hammer/hammer.js",
"components/hammer/jquery.hammer.js",
"components/overthrow/overthrow.js",
"components/webdb/webdb.js"
]
# =========================================================================
coffee:
core_debug: files: '<%=meta.package%>/js/<%=meta.file%>.debug.js': "<%=meta.temp%>/<%=meta.file%>.coffee"
concat:
components:
src: "<%= source.components %>", dest: "<%=meta.temp%>/<%=meta.file%>.components.js"
core:
src: "<%= source.coffee %>", dest: "<%=meta.temp%>/<%=meta.file%>.coffee"
uglify:
options: compress: false
components: files: '<%=meta.package%>/js/<%=meta.file%>.components.js': '<%=meta.temp%>/<%=meta.file%>.components.js'
engine: files: '<%=meta.package%>/js/<%=meta.file%>.js': '<%=meta.package%>/js/<%=meta.file%>.debug.js'
stylus:
core:
options: compress: true, import: [ 'Tako.constants']
files: '<%=meta.package%>/stylesheets/<%=meta.file%>.css': '<%=source.stylus%>'
theme:
options: compress: true, import: [ 'Tako.constants']
files: '<%=meta.package%>/stylesheets/<%=meta.file%>.theme.css': '<%=source.theme%>'
usebanner:
components:
options: position: "top", banner: "<%= meta.banner %>", linebreak: false
files: src: [
'<%=meta.package%>/js/<%=meta.file%>.components.js'
]
js:
options: position: "top", banner: "<%= meta.banner %>", linebreak: false
files: src: [
'<%=meta.package%>/js/<%=meta.file%>.debug.js',
'<%=meta.package%>/js/<%=meta.file%>.js'
]
css:
options: position: "top", banner: "<%= meta.banner %>", linebreak: false
files: src: [
'<%=meta.package%>/stylesheets/<%=meta.file%>.css'
]
theme:
options: position: "top", banner: "<%= meta.banner %>", linebreak: false
files: src: [
'<%=meta.package%>/stylesheets/<%=meta.file%>.theme.css'
]
watch:
coffee:
files: ["<%= source.coffee %>"]
tasks: [ "concat:core", "coffee:core_debug", "uglify:engine", "usebanner:js"]
stylus:
files: ["<%= source.stylus %>"]
tasks: ["stylus:core", "usebanner:css"]
theme:
files: ["<%= source.theme %>"]
tasks: ["stylus:theme", "usebanner:theme"]
grunt.loadNpmTasks "grunt-contrib-coffee"
grunt.loadNpmTasks "grunt-contrib-uglify"
grunt.loadNpmTasks "grunt-contrib-stylus"
grunt.loadNpmTasks "grunt-contrib-concat"
grunt.loadNpmTasks "grunt-contrib-watch"
grunt.loadNpmTasks "grunt-banner"
grunt.registerTask "default", [ "concat", "coffee", "uglify", "stylus", "concat", "usebanner"]