-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.coffee
138 lines (115 loc) · 3.29 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
path = require( "path" )
module.exports = (grunt) ->
banner =
# Project configuration.
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
banner: """
/*
* IGGY <%= pkg.version %> ( <%= grunt.template.today( 'yyyy-mm-dd' )%> )
* http://mpneuried.github.io/iggy/
*
* Released under the MIT license
* https://github.com/mpneuried/iggy/blob/master/LICENSE
*/
"""
watch:
css:
files: ["_src/css/**/*.styl"]
tasks: [ "build-core-css"]
stylus:
options:
"include css": true
banner: "<%= banner %>"
base:
files:
"css/iggy.css": ["_src/css/main.styl"]
clean:
base:
src: [ "js", "test" ]
browserify:
base:
options:
transform: ["jadeify", "coffeeify"]
browserifyOptions:
extensions: ".coffee"
standalone: "IGGY"
external: true
files:
'js/iggy.js': "_src/js/main.coffee"
basedebug:
options:
transform: ["jadeify", "coffeeify"]
browserifyOptions:
debug: true
extensions: ".coffee"
standalone: "IGGY"
external: true
files:
'js/iggy.debug.js': "_src/js/main.coffee"
dev:
options:
watch: true
keepAlive: true
transform: ["jadeify", "coffeeify"]
watchifyOptions:
poll: 500
browserifyOptions:
debug: true
extensions: ".coffee"
standalone: "IGGY"
external: true
files:
'js/iggy.debug.js': "_src/js/main.coffee"
compress:
options:
mode: "tgz"
archive: '_release/release_<%= pkg.version %>.tar.gz'
pretty: true
release:
src: [ "package.json", "README.md", "LICENSE", "dist/**" ]
dest: "iggy_<%= pkg.version %>/"
copy:
release:
src: ['css/iggy.css']
dest: 'dist/css/iggy.css'
no_uglify:
files:
'dist/js/iggy.js': "js/iggy.js"
# karma:
# local:
# configFile: 'karma.conf.coffee'
uglify:
options:
compress: true
banner: "<%= banner %>"
release:
files:
'dist/js/iggy.js': "js/iggy.js"
# Load npm modules
grunt.loadNpmTasks "grunt-contrib-watch"
grunt.loadNpmTasks "grunt-contrib-copy"
grunt.loadNpmTasks "grunt-contrib-stylus"
grunt.loadNpmTasks "grunt-contrib-clean"
grunt.loadNpmTasks "grunt-contrib-uglify"
grunt.loadNpmTasks "grunt-contrib-compress"
grunt.loadNpmTasks "grunt-browserify"
#grunt.loadNpmTasks "grunt-karma"
# just a hack until this issue has been fixed: https://github.com/yeoman/grunt-regarde/issues/3
grunt.option('force', not grunt.option('force'))
# ALIAS TASKS
grunt.registerTask "watcher", ["browserify:dev"]
grunt.registerTask "default", "build"
grunt.registerTask "clear", [ "clean:base" ]
#grunt.registerTask "test-local", "karma:local"
# build the project
grunt.registerTask "build-core-js", [ "browserify:base" ]
grunt.registerTask "build-core-js-debug", [ "browserify:basedebug", "browserify:base" ]
grunt.registerTask "build-core-css", [ "stylus:base"]
grunt.registerTask "build-core", [ "build-core-js", "build-core-js-debug", "build-core-css"]
grunt.registerTask "build", [ "clear", "build-core"]
grunt.registerTask "release", [ "build", "uglify:release", "copy:release", "compress:release" ]
grunt.registerTask "release-nouglify", [ "build", "copy:no_uglify", "copy:release", "compress:release" ]
# shortcuts
grunt.registerTask "w", "watcher"
grunt.registerTask "b", "build"