forked from chuckcarpenter/REM-unit-polyfill
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
50 lines (40 loc) · 1.65 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
'use strict'
module.exports = (grunt) ->
# load all grunt tasks
# this assumes matchdep, grunt-contrib-watch, grunt-contrib-coffee,
# grunt-coffeelint, grunt-contrib-clean, grunt-contrib-uglify is in the package.json file
require('matchdep').filterDev('grunt-*').forEach grunt.loadNpmTasks
grunt.initConfig
# load in the module information
pkg: grunt.file.readJSON 'package.json'
# path to Grunt file for exclusion
gruntfile: 'Gruntfile.coffee'
# generalize the module information for banner output
banner: '/**\n' +
' * Module: <%= pkg.name %> - v<%= pkg.version %>\n' +
' * Description: <%= pkg.description %>\n' +
' * Date Built: <%= grunt.template.today("yyyy-mm-dd") %>\n' +
' * Copyright (c) <%= grunt.template.today("yyyy") %>' +
' | <%= pkg.authors %>;\n' +
'**/\n'
# clear out any unneccessary files
clean: ['js/<%= pkg.name %>.min.js']
# lint our files, because it's a good thing
jshint:
options:
jshintrc: '.jshintrc'
basic:
src: ['js/<%= pkg.name %>.js']
# clean up, minify and prepare for production use
uglify:
options:
banner: '<%= banner %>'
minify:
files:
'js/<%= pkg.name %>.min.js': 'js/<%= pkg.name %>.js'
## TODO: add some tests
grunt.registerTask 'default', [
'clean'
'jshint'
'uglify'
]