-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathGruntfile.coffee
94 lines (81 loc) · 3.01 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
module.exports = (grunt) ->
grunt.config.init
coffee:
src:
expand: true
cwd: "src/"
src: ["**/*.coffee"]
dest: "lib-js/"
ext: ".js"
watch:
src:
options:
atBegin: true
files: "src/**/*.coffee"
tasks: ["build:src"]
browserify:
scales_page:
src: ['lib-js/pages/scales_page.js']
dest: 'public/app.js'
options:
browserifyOptions:
noParse: [
'lib/ev_channel.js'
'lib/jquery.js'
'lib/howler.js'
'lib/async.js'
]
uglify:
options:
banner: '/* <%= grunt.template.today("yyyy-mm-dd h:MM:ss") %> */'
mangle:
except: ["jQuery", "require"]
build:
files:
'public/min/app.js': ['public/app.js']
copy:
js: {expand: true, cwd: 'public/min', src:'app.js', dest: 'dist/public'}
css: {expand: true, cwd: 'public/min', src:'fretsmap.css', dest: 'dist/public'}
main: {expand: true, src: 'index.html', dest: 'dist'}
about: {expand: true, src: 'about.html', dest: 'dist'}
feedback: {expand: true, src: 'feedback.html', dest: 'dist'}
resources: {expand: true, src: 'resources/**', dest: 'dist'}
fonts: {expand: true, src: 'fonts/*', dest: 'dist'}
'gh-pages':
options:
base: 'dist'
src: ['**']
notify:
build:
options:
title: 'Build'
message: 'Build is done'
deploy:
options:
title: 'Deploy'
message: 'Deployed to gh pages'
react_render:
index:
options:
src: "./dist/index.html"
cssmin:
combine:
files:
'public/min/fretsmap.css': ['public/fretsmap.css']
concat:
css:
src: ['css/bootstrap.css', 'css/style.css']
dest: 'public/fretsmap.css'
grunt.loadNpmTasks "grunt-contrib-watch"
grunt.loadNpmTasks "grunt-contrib-coffee"
grunt.loadNpmTasks "grunt-contrib-uglify"
grunt.loadNpmTasks "grunt-contrib-copy"
grunt.loadNpmTasks "grunt-contrib-cssmin"
grunt.loadNpmTasks "grunt-contrib-concat"
grunt.loadNpmTasks "grunt-gh-pages"
grunt.loadNpmTasks "grunt-browserify"
grunt.loadNpmTasks "grunt-notify"
grunt.loadNpmTasks "grunt-react-render"
grunt.registerTask "build", ["coffee", "browserify", "notify:build", "concat"]
grunt.registerTask "deploy", ["build", "uglify", "cssmin", "copy", "react_render"]
grunt.registerTask "deploy-gh", ["deploy", "gh-pages", "notify:deploy"]