-
Notifications
You must be signed in to change notification settings - Fork 14
/
Gruntfile.js
72 lines (67 loc) · 2.21 KB
/
Gruntfile.js
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
module.exports = function(grunt) {
var version = require('./package.json').version
var configuration = {
pkg: grunt.file.readJSON('package.json'),
jshint: {
allFiles: [
'Gruntfile.js',
'src/**/*.js',
'public/**/*.js',
'tests/**/*.js',
'index.js'
],
options: {
jshintrc: '.jshintrc',
}
},
requirejs: {
main: {
options: {
baseUrl: './public/js',
name: 'main',
out: './public/main.' + version + '.js',
mainConfigFile: './public/js/main.js',
paths: {
'socket.io': 'empty:',
'requireLib': 'require'
},
include: [
'requireLib'
]
}
},
application: {
options: {
baseUrl: './public/js',
name: 'app',
out: './public/app.' + version + '.js',
mainConfigFile: './public/js/app.js',
paths: {
'socket.io': 'empty:',
'requireLib': 'require'
},
include: [
'requireLib'
]
}
},
css: {
options: {
cssIn: './public/style/main.css',
out: './public/app.' + version + '.css',
optimizeCss: 'standard'
}
}
}
}
grunt.initConfig(configuration)
// Load the plugins
grunt.loadNpmTasks('grunt-contrib-jshint')
grunt.loadNpmTasks('grunt-contrib-requirejs')
grunt.loadNpmTasks('grunt-nsp-package')
// Configure tasks
grunt.registerTask('default', ['build'])
grunt.registerTask('checkstyle', [ 'jshint' ])
grunt.registerTask('test', ['build', 'validate-package'])
grunt.registerTask('build', [ 'requirejs:main', 'requirejs:application', 'requirejs:css' ])
}