-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntfile.coffee
58 lines (51 loc) · 1.28 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
module.exports = ->
# Project configuration
@initConfig
pkg: @file.readJSON 'package.json'
webpack:
dist:
entry: './src/runner.coffee'
output:
path: './dist/'
filename: 'rss-generator.js'
node:
fs: 'empty'
module:
loaders: [
test: /\.coffee$/
loader: 'coffee-loader'
,
test: /\.json$/
loader: 'json-loader'
]
# BDD tests on Node.js
mochaTest:
nodejs:
src: ['spec/*.coffee']
options:
reporter: 'spec'
require: 'coffee-script/register'
# Coding standards
coffeelint:
components:
files:
src: ['src/*.coffee']
options:
max_line_length:
value: 80
level: 'warn'
connect:
fixtures:
options:
port: 8001
base: 'dist'
# Grunt plugins used for building
@loadNpmTasks 'grunt-webpack'
# Grunt plugins used for testing
@loadNpmTasks 'grunt-mocha-test'
@loadNpmTasks 'grunt-coffeelint'
@loadNpmTasks 'grunt-contrib-connect'
# Our local tasks
@registerTask 'build', ['webpack']
@registerTask 'test', ['coffeelint', 'build', 'connect', 'mochaTest']
@registerTask 'default', ['test']