This repository was archived by the owner on Jun 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathGruntfile.js
More file actions
122 lines (112 loc) · 3.55 KB
/
Gruntfile.js
File metadata and controls
122 lines (112 loc) · 3.55 KB
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
114
115
116
117
118
119
120
121
122
/*global module:false*/
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
banner:
'// Thumbs.js <%= pkg.version %>\n' +
'//\n' +
'// Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>.\n' +
'// Distributed under <%= pkg.license %> license.\n' +
'//\n' +
'// http://thumbsjs.com\n'
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
thumbs: {
src: [
'src/*.js'
]
}
},
jasmine: {
options: {
helpers: [
'components/sinon/index.js',
'components/jasmine-sinon/lib/jasmine-sinon.js',
'components/jasmine-jquery/lib/jasmine-jquery.js',
'test/helpers.js'
],
vendor: [
'components/jquery/dist/jquery.js',
'components/underscore/underscore.js',
'components/backbone/backbone.js'
]
},
thumbs: {
src: [
'src/thumbs.core.js',
'src/thumbs.class.js',
'src/thumbs.model.js',
'src/thumbs.collection.js',
'src/thumbs.history.js',
'src/thumbs.router.js',
'src/thumbs.view.js',
'src/thumbs.templateView.js'
],
options: {
specs: 'test/spec/*.spec.js'
}
},
build: {
src: ['thumbs.min.js'],
options: {
specs: '<%= jasmine.thumbs.options.specs %>'
}
}
},
preprocess: {
options: {
inline: true,
context: {
banner: '<%= meta.banner %>'
}
},
build: {
files: {
'thumbs.js': 'src/thumbs.core.js'
}
}
},
uglify: {
options: {
banner: '<%= meta.banner %>'
},
dist: {
src: ['<banner:meta.banner>', 'thumbs.js'],
dest: '<%= pkg.name %>.min.js'
}
},
connect: {
server: {
options: {
port: 8888,
base: '.',
hostname: '*'
}
}
},
clean: ['node_modules', "components"],
watch: {
thumbs: {
files: ['src/*.js', 'test/spec/*.spec.js'],
tasks: ['jshint', 'jasmine:thumbs']
}
}
});
// Default task.
grunt.registerTask('default', ['build']);
grunt.registerTask('build', ['jshint', 'test', 'preprocess', 'uglify']);
grunt.registerTask('test', ['jshint', 'jasmine:thumbs']);
grunt.registerTask('server', ['connect:server:keepalive']);
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-preprocess');
};