forked from tapquo/Lungo.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrunt.js
113 lines (101 loc) · 3.56 KB
/
grunt.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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: '<json:packages/lungo/component.json>',
meta: {
file: "lungo",
// BETA
endpoint: "example/components",
version: ".brownie",
// RELEASE
// endpoint: "packages",
// version: "",
banner: '/* <%= pkg.name %> v<%= pkg.version %> - <%= grunt.template.today("yyyy/m/d") %>\n' +
' <%= pkg.homepage %>\n' +
' Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>' +
' - Licensed <%= _.pluck(pkg.license, "type").join(", ") %> */'
},
resources: {
coffeescripts: ['src/**/*.coffee'],
core: ['build/src/Lungo.js'],
modules: [
'build/src/Lungo.js',
'build/src/modules/Lungo.Attributes.js',
'build/src/modules/Lungo.Cache.js',
'build/src/modules/Lungo.Constants.js',
'build/src/modules/Lungo.Core.js',
'build/src/modules/Lungo.Dom.js',
'build/src/modules/Lungo.Events.js',
'build/src/modules/Lungo.Fallback.js',
'build/src/modules/Lungo.Init.js',
'build/src/modules/Lungo.Notification.js',
'build/src/modules/Lungo.Resource.js',
'build/src/modules/Lungo.Scroll.js',
'build/src/modules/Lungo.Service.js',
'build/src/modules/Lungo.Router.js',
'build/src/modules/Lungo.Aside.js',
'build/src/modules/Lungo.Section.js',
'build/src/boot/*.js',
'build/src/element/*.js'],
stylesheets: [
'src/**/lungo.base.styl',
'src/**/lungo.layout.styl',
'src/**/lungo.layout.*.styl',
'src/**/lungo.widgets.styl',
'src/**/lungo.widgets.*.styl',
'src/**/lungo.media.*.styl'],
icons: ['src/**/lungo.icon**.styl'],
themes: ['src/**/theme**.styl']
},
coffee: {
lungo: {
src: ['<config:resources.coffeescripts>'],
dest: 'build',
options: {
bare: true,
preserve_dirs: true
}
}
},
concat: {
js: {
src: ['<banner>', '<config:resources.core>', '<config:resources.modules>'],
dest: 'build/<%=meta.file%>.js'
}
},
min: {
js: {
src: ['<banner>', 'build/<%=meta.file%>.js'],
dest: '<%=meta.endpoint%>/<%=meta.file%><%=meta.version%>/<%=meta.file%>.js'
}
},
stylus: {
stylesheets: {
options: { compress: true, paths: ['src/stylesheets/import'] },
files: { '<%=meta.endpoint%>/<%=meta.file%><%=meta.version%>/<%=meta.file%>.css': '<config:resources.stylesheets>' }
},
icons: {
options: { compress: true },
files: { '<%=meta.endpoint%>/<%=meta.file%>.icon/**.css': '<config:resources.icons>' }
},
themes: {
options: { flatten: true },
files: { '<%=meta.endpoint%>/<%=meta.file%><%=meta.version%>/**.css': '<config:resources.themes>' }
}
},
copy: {
theme: {
files: { '<%=meta.endpoint%>/<%=meta.file%>.theme/': ['<config:resources.themes>'] }
}
},
watch: {
files: ['<config:resources.coffeescripts>', '<config:resources.stylesheets>', '<config:resources.themes>'],
tasks: 'coffee concat min stylus:stylesheets stylus:themes'
}
});
grunt.loadNpmTasks('grunt-coffee');
grunt.loadNpmTasks('grunt-contrib-stylus');
grunt.loadNpmTasks('grunt-contrib-copy');
// Default task.
grunt.registerTask('default', 'coffee concat min stylus copy');
};