-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
113 lines (108 loc) · 2.29 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
'use strict'
module.exports = function (grunt) {
var DOC_DIR = 'doc'
var BUILD_DIR = 'dist'
var TEST_DIR = 'test'
var SRC_DIR = 'src'
var DEMO_DIR = 'demo'
var MODULE_FILE_NAME = 'connexion'
grunt.initConfig({
jshint: {
dev: {
options: {
jshintrc: '.jshintrc'
},
src: [
SRC_DIR + '/**/*.js'
]
}
},
watch: {
sources: {
files: [
SRC_DIR + '/**/*.js',
SRC_DIR + '/**/*.json',
TEST_DIR + '/**/*.js',
TEST_DIR + '/**/*.json',
DEMO_DIR + '/**/*'
],
//tasks: ['jshint'],
options: {
interrupt: true,
livereload: 35729
}
}
},
jsdoc: {
dist: {
src: [SRC_DIR + '/index.js'],
dest: DOC_DIR
}
},
clean: {
doc: [DOC_DIR],
build: [BUILD_DIR],
test: [TEST_DIR + '/test.js']
},
jasmine: {
dev: {
//src: '',
options: {
//polyfills: [''],
//helpers: [''],
keepRunner: false,
outfile: TEST_DIR + '/test.html',
specs: [TEST_DIR + '/test.js']
}
}
},
systemjs: {
build: {
src: SRC_DIR + '/index.js',
dest: BUILD_DIR + '/' + MODULE_FILE_NAME + '.js',
options: {
baseURL: SRC_DIR,
config: 'system.config.js',
type: 'build',
format: 'umd',
minify: false,
sourceMaps: true
}
},
buildmin: {
src: SRC_DIR + '/index.js',
dest: BUILD_DIR + '/'+ MODULE_FILE_NAME + '.min.js',
options: {
baseURL: SRC_DIR,
config: 'system.config.js',
type: 'build',
format: 'umd',
minify: true,
sourceMaps: true
}
},
test: {
src: TEST_DIR + '/spec.js',
dest: TEST_DIR + '/test.js',
options: {
baseURL: TEST_DIR,
config: 'system.config.js',
type: 'build',
format: 'umd',
minify: false
}
}
}
})
grunt.loadNpmTasks('grunt-contrib-jshint')
grunt.loadNpmTasks('grunt-contrib-watch')
grunt.loadNpmTasks('grunt-jsdoc')
grunt.loadNpmTasks('grunt-contrib-clean')
grunt.loadNpmTasks('grunt-contrib-jasmine')
grunt.loadNpmTasks('grunt-systemjs-bundler')
grunt.registerTask('live', ['watch'])
grunt.registerTask('code', ['jshint:dev'])
grunt.registerTask('doc', ['clean:doc', 'jsdoc'])
grunt.registerTask('test', ['systemjs:test', 'jasmine', 'clean:test'])
grunt.registerTask('build', ['clean:build', 'systemjs:build', 'systemjs:buildmin'])
}