-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
44 lines (38 loc) · 1.04 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
module.exports = (grunt) ->
'use strict'
pkg = require './package.json'
for name of pkg.devDependencies when name.substring(0, 6) is 'grunt-'
grunt.loadNpmTasks name
grunt.initConfig
pkg: pkg
clean: ['dist']
concat:
options:
stripBanners: true
banner: '''
/*!
* <%= pkg.title || pkg.name %> v<%= pkg.version %>
* <%= pkg.homepage %>
*
* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> <<%= pkg.author.email %>>
* Released under the MIT license
*/
'''
dist:
src: ['dist/<%= pkg.filename %>.js']
dest: 'dist/<%= pkg.filename %>.js'
uglify:
options:
banner: '''
/*! <%= pkg.title || pkg.name %> v<%= pkg.version %> - <%= pkg.homepage %> */
'''
dist:
src: ['<%= concat.dist.dest %>']
dest: 'dist/<%= pkg.filename %>.min.js'
coffee:
compile:
options:
bare: true
files:
'dist/<%= pkg.filename %>.js': 'src/*.coffee'
grunt.registerTask 'default', ['clean', 'coffee', 'concat', 'uglify']