-
Notifications
You must be signed in to change notification settings - Fork 0
/
gruntfile.coffee
68 lines (57 loc) · 1.38 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
#global module:false
module.exports = (grunt) ->
grunt.loadNpmTasks "grunt-contrib-concat"
grunt.loadNpmTasks "grunt-contrib-copy"
grunt.loadNpmTasks "grunt-browserify"
grunt.loadNpmTasks "grunt-contrib-coffee"
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.initConfig
pkg: grunt.file.readJSON("package.json")
coffee:
addon:
expand: true
cwd: 'src/js/',
src: ['**/*.coffee']
dest: 'build/js/'
ext: '.js'
options:
bare: true
copy:
addon:
expand: true
cwd: 'src/'
src: ['**/*.js']
dest: 'build'
browserify:
addon:
cwd: "build/js/"
src: ["addon.js"]
dest: "build/addon.js"
options:
alias: ["./build/js/addon.js:addon"]
# wrapp as Taist addon
postBundleCB: (err, src, next) ->
src = "function init(){var " + src + ";return require(\"addon\")}"
next err, src
return
concat:
addon:
src: [
"build/addon.js"
"src/lib/sample.js"
]
dest: "dist/addon.js"
watch:
files: ['src/js/**/*.js', 'src/js/**/*.coffee']
tasks: ['build']
grunt.registerTask "default", [
"build"
"watch"
]
grunt.registerTask "build", [
"coffee:addon"
"copy:addon"
"browserify:addon"
"concat:addon"
]
return