-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathGruntfile.js
More file actions
73 lines (69 loc) · 2.19 KB
/
Gruntfile.js
File metadata and controls
73 lines (69 loc) · 2.19 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
module.exports = function(grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
meta : {
pkg : grunt.file.readJSON('package.json'),
banner : '/*! <%= meta.pkg.title || meta.pkg.name %> - v<%= meta.pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= meta.pkg.homepage ? "* " + meta.pkg.homepage + "\\n" : "" %>' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= meta.pkg.author.name %>;' +
' Licensed <%= _.pluck(meta.pkg.licenses, "type").join(", ") %> */\n',
src : ['src/events.js', 'src/proxy.js', 'src/deps.js', 'src/scope.js', 'src/render.js'],
vendor : ['lib/underscore/underscore.js', 'lib/jquery/jquery-latest.js', 'src/undermore.js'],
specs : ['specs/**/*Spec.js']
},
jasmine : {
src : '<%= meta.src %>',
options : {
specs : '<%= meta.specs %>',
vendor : '<%= meta.vendor %>',
template : 'specs/grunt-SpecRunner.tmpl',
helpers : ['testEnv/testEnv.js', 'testEnv/fixtures.js', 'specs/grunt-SpecHelper.js']
}
},
jshint: {
all: [
'Gruntfile.js',
'<%= meta.src %>'
],
options: {
jshintrc: '.jshintrc'
}
},
concat: {
dist: {
src : '<%= meta.src %>',
dest : 'dist/boundjs.<%= meta.pkg.version %>.js'
}
},
uglify: {
pack: {
files : {
'dist/boundjs.<%= meta.pkg.version %>.min.js': 'dist/boundjs.<%= meta.pkg.version %>.js'
}
},
options: {
banner : '<%= meta.banner %>',
mangle : false
}
},
watch: {
test : {
files : ['<%= meta.src %>','<%= meta.specs %>'],
tasks : 'test'
}
}
});
// Load third-party modules
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
// Define tasks
grunt.registerTask('test', ['jshint', 'jasmine']);
grunt.registerTask('dist', ['concat', 'uglify']);
// Define default task
grunt.registerTask('default', ['test']);
};