-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
62 lines (54 loc) · 1.24 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
module.exports = (grunt) ->
# Package
# =======
pkg = require './package.json'
if process.env['DEV'] is 'true'
pkg.distDirectory = pkg.devDistDirectory
# Configuration
# =============
grunt.initConfig
pkg: pkg
concat:
dist:
src: [
'src/global.js',
'src/*.js',
'src/**/*.js'
]
dest: '<%= pkg.distDirectory %>/<%= pkg.name %>-latest.js'
uglify:
options:
mangle: false
compress: false
beautify: true
preserveComments: 'some'
banner: '''
/*!
* Form helpers
* @author Paul Dufour
* @company Brit + Co
*/
'''
dist:
src: '<%= pkg.distDirectory %>/<%= pkg.name %>-latest.js'
dest: '<%= pkg.distDirectory %>/<%= pkg.name %>-latest.js'
watch:
files: ['./src/**/*.js']
tasks: ['concat','uglify']
# Dependencies
# ============
for name of pkg.devDependencies when name.substring(0, 6) is 'grunt-'
grunt.loadNpmTasks name
# Tasks
# =====
grunt.registerTask 'default', ->
grunt.task.run 'concat'
grunt.task.run 'uglify'
grunt.task.run 'watch'
grunt.registerTask 'build', ->
# Build for release
grunt.task.run 'concat'
grunt.config.set('uglify.dist.dest',
'<%= pkg.distDirectory %>/<%= pkg.name %>-latest.js'
)
grunt.task.run 'uglify'