-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGruntfile.coffee
61 lines (50 loc) · 1.29 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
module.exports = (grunt) ->
grunt.initConfig
# Package meta
pkg: grunt.file.readJSON 'package.json'
srcDir: './src'
buildDir: './dist'
coffeeCompiledDir: '<%= buildDir %>/cjs'
# Tasks Settings
coffee:
build:
options:
# Remove unnecessary function call wrap.
bare: true
expand: true
flattern: true
cwd: '<%= srcDir %>'
src: ['**/*.coffee']
dest: '<%= coffeeCompiledDir %>'
ext: '.js'
browserify:
build:
files:
'<%= buildDir %>/<%= pkg.main %>': ['<%= coffeeCompiledDir %>/**/*.js']
shell:
convert:
command: 'make convert_crx'
watch:
scripts:
files: ['<%= srcDir %>/**/*.coffee']
tasks: ['shell:convert']
clean:
build: ['<%= buildDir %>']
grunt.loadNpmTasks 'grunt-contrib-clean'
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-browserify'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-shell'
# Compile script with coffee & browserify
grunt.registerTask 'compile', [
'coffee:build'
'browserify:build'
]
grunt.registerTask 'default', [
'clean:build'
'compile'
]
grunt.registerTask 'develop', [
'default'
'watch'
]