-
Notifications
You must be signed in to change notification settings - Fork 72
/
Gruntfile.coffee
51 lines (43 loc) · 1.19 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
module.exports = (grunt) ->
grunt.initConfig
coffee:
app:
expand: true
cwd: 'coffee'
src: ['*.coffee']
dest: 'js'
ext: '.js'
concat:
app:
src: ['js/jsOTP.js', 'js/sha_dev.js']
dest: 'dist/jsOTP.js'
uglify:
app:
options:
banner: """/*
* File combining
* (1) sha.js by Brian Turek 2008-2013 under BSD license
* (2) and a modified js OTP implementation found on JSFiddle
*/\n
"""
files:
'dist/jsOTP.min.js': ['dist/jsOTP.js']
'dist/jsOTP-es5.min.js': ['dist/jsOTP-es5.js']
watch:
app:
files: 'src/*.coffee'
tasks: ['default']
babel:
options:
presets: ['es2015']
dist:
files:
'dist/jsOTP-es5.js': 'dist/jsOTP.js'
# These plugins provide necessary tasks.
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-contrib-concat'
grunt.loadNpmTasks 'grunt-contrib-uglify-es'
grunt.loadNpmTasks 'grunt-babel'
# Default task.
grunt.registerTask 'default', ['coffee', 'concat', 'babel']