-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.coffee
executable file
·147 lines (132 loc) · 3.89 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
139
140
141
142
143
144
145
146
147
'use strict'
module.exports = (grunt)->
require('time-grunt')(grunt)
grunt.initConfig
dirs:
bower: 'BowerComponents'
base: 'Resources'
private: '<%= dirs.base %>/Private'
public: '<%= dirs.base%>/Public'
preferName: 'nodeGenerator'
asset: '<%= dirs.private %>/Assets'
coffee:
src: '<%= dirs.asset %>/CoffeeScripts'
compiled: '<%= dirs.public %>/JavaScripts/Compiled'
dest: '<%= dirs.public %>/JavaScripts'
scss:
src: '<%= dirs.asset %>/Styles',
dest: '<%= dirs.public %>/Styles'
complied: '<%= dirs.scss.dest %>/Compiled'
image:
src: '<%= dirs.asset %>/UnprocessImages'
dest: '<%= dirs.public %>/Images'
fontAwesome: '<%= dirs.bower %>/font-awesome'
bootstrap:
base: '<%= dirs.asset %>/Bootstrap'
js: '<%= dirs.bootstrap.base %>/JavaScripts'
css: '<%= dirs.bootstrap.base %>/Styles'
clean:
font:
src: ['<%= dirs.fontAwesome.dest %>']
coffee:
src: ['<%= dirs.coffee.dest %>/**/*.js']
scss:
src: ['<%= dirs.scss.dest %>/**/*.css']
image:
src: ['<%= dirs.image.dest %>/**/*.{png,jpg,gif,ico}']
copy:
fontAwesome:
expand: true
flatten: true
src: '<%= dirs.fontAwesome %>/fonts/*'
dest: '<%= dirs.public %>/fonts'
compass:
custom:
options:
sassDir: '<%= dirs.scss.src %>'
cssDir: '<%= dirs.scss.complied %>'
outputStyle: 'expanded'
coffee:
app:
expand: true
flatten: true,
src: ['<%= dirs.coffee.src %>/**/*.coffee']
dest: '<%= dirs.coffee.compiled %>'
ext: '.js'
concat:
js:
src: [
'<%= dirs.bootstrap.js %>/jquery.min.js',
'<%= dirs.bootstrap.js %>/tether.min.js'
'<%= dirs.bootstrap.js %>/bootstrap.min.js'
'<%= dirs.coffee.compiled %>/**/*.js'
]
dest: '<%= dirs.coffee.dest %>/<%= dirs.preferName %>.js'
options:
separator: ';'
html5shiv:
src: [
'<%= dirs.bootstrap.js %>/ie10-viewport-bug-workaround.js'
]
dest: '<%= dirs.coffee.dest %>/html5shiv.js'
options:
separator: ';'
css:
src: [
'<%= dirs.fontAwesome %>/css/font-awesome.min.css'
'<%= dirs.bootstrap.css %>/bootstrap.min.css'
'<%= dirs.scss.complied %>/<%= dirs.preferName %>.css'
]
dest: '<%= dirs.scss.dest %>/<%= dirs.preferName %>.css'
options:
separator: ';'
uglify:
js:
src: '<%= dirs.coffee.dest %>/<%= dirs.preferName %>.js'
dest: '<%= dirs.coffee.dest %>/<%= dirs.preferName %>.min.js'
html5shiv:
src: '<%= dirs.coffee.dest %>/html5shiv.js'
dest: '<%= dirs.coffee.dest %>/html5shiv.min.js'
cssmin:
css:
src: '<%= dirs.scss.dest %>/<%= dirs.preferName %>.css'
dest: '<%= dirs.scss.dest %>/<%= dirs.preferName %>.min.css'
imagemin:
project:
files: [{
expand: true,
cwd: '<%= dirs.image.src %>',
src: ['**/*.{png,jpg,gif,ico}'],
dest: '<%= dirs.image.dest %>'
}]
watch:
grunt:
files: ['Gruntfile.coffee']
tasks: 'build'
coffee:
files: '<%= dirs.coffee.src %>/**/*.coffee'
tasks: 'script'
scss:
files: [
'<%= dirs.scss.src %>/**/*.scss'
],
tasks: 'style'
imagemin:
files: [
'<%= dirs.image.src %>/**/*.{png,jpg,gif,ico}'
]
tasks: 'image'
grunt.loadNpmTasks 'grunt-contrib-clean'
grunt.loadNpmTasks 'grunt-contrib-copy'
grunt.loadNpmTasks 'grunt-contrib-compass'
grunt.loadNpmTasks 'grunt-contrib-concat'
grunt.loadNpmTasks 'grunt-contrib-uglify'
grunt.loadNpmTasks 'grunt-contrib-cssmin'
grunt.loadNpmTasks 'grunt-contrib-imagemin'
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.registerTask 'default', ['build', 'watch']
grunt.registerTask 'script', ['clean:coffee', 'coffee', 'concat:js', 'concat:html5shiv', 'uglify']
grunt.registerTask 'style', ['clean:scss', 'compass', 'concat:css', 'cssmin']
grunt.registerTask 'image', ['clean:image', 'imagemin']
grunt.registerTask 'build', ['copy', 'script', 'style', 'image']