forked from karinashenaz/bc-qr-reader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.coffee
73 lines (63 loc) · 1.9 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
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON("package.json")
clean: {
dist: ["dist"]
build: ["build"]
}
concat:
options:
separator: ";"
bc_qr_reader:
src: [
'src/jsqrcode/src/grid.js'
'src/jsqrcode/src/version.js'
'src/jsqrcode/src/detector.js'
'src/jsqrcode/src/formatinf.js'
'src/jsqrcode/src/errorlevel.js'
'src/jsqrcode/src/bitmat.js'
'src/jsqrcode/src/datablock.js'
'src/jsqrcode/src/bmparser.js'
'src/jsqrcode/src/datamask.js'
'src/jsqrcode/src/rsdecoder.js'
'src/jsqrcode/src/gf256poly.js'
'src/jsqrcode/src/gf256.js'
'src/jsqrcode/src/decoder.js'
'src/jsqrcode/src/qrcode.js'
'src/jsqrcode/src/findpat.js'
'src/jsqrcode/src/alignpat.js'
'src/jsqrcode/src/databr.js'
'build/src/bc-qr-reader.js'
]
dest: "build/bc-qr-reader-concat.js"
coffee:
coffee_to_js:
options:
bare: true
sourceMap: false
expand: true
flatten: false
src: ["src/bc-qr-reader.js.coffee"]
dest: 'build'
ext: ".js"
surround:
wraps:
options:
prepend: '(function() { if (/internet explorer/i.test(window.navigator.userAgent) || /MSIE/i.test(window.navigator.userAgent)) { return; }',
append: '})()'
files: [{
src: 'build/bc-qr-reader-concat.js'
dest: 'dist/bc-qr-reader.js'
}]
grunt.loadNpmTasks('grunt-contrib-concat')
grunt.loadNpmTasks('grunt-contrib-coffee')
grunt.loadNpmTasks('grunt-contrib-clean')
grunt.loadNpmTasks('grunt-surround')
grunt.registerTask "compile", ["coffee"]
grunt.registerTask "dist", [
"clean"
"compile"
"concat"
"surround"
]
return