-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.coffee
55 lines (49 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
module.exports = ->
grunt = @
# Project configuration
@initConfig
pkg: @file.readJSON 'package.json'
browserify:
dist:
files:
'dist/alan-view.js': ['src/main.coffee']
options:
browserifyOptions:
extensions: ['.coffee']
fullPaths: false
standalone: 'alan-view'
# CoffeeScript compilation of tests
coffee:
spec:
options:
bare: true
expand: true
cwd: 'specs'
src: ['**.coffee']
dest: 'specs'
ext: '.js'
src:
options:
bare: true
expand: true
cwd: 'src'
src: ['**.coffee']
dest: 'src'
ext: '.js'
# Automated recompilation and testing when developing
watch:
files: ['specs/*.coffee', 'src/*.coffee']
tasks: ['test']
# Coding standards
coffeelint:
components: ['Gruntfile.coffee', 'specs/*.coffee', 'src/*.coffee']
options:
max_line_length:
level: 'ignore'
@loadNpmTasks 'grunt-contrib-coffee'
@loadNpmTasks 'grunt-contrib-watch'
@loadNpmTasks 'grunt-coffeelint'
@loadNpmTasks 'grunt-browserify'
@registerTask 'build', ['coffee', 'browserify']
@registerTask 'test', ['coffeelint', 'coffee']
@registerTask 'default', ['build']