-
Notifications
You must be signed in to change notification settings - Fork 1
/
gruntfile.js
executable file
·88 lines (87 loc) · 2.9 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
browserify: {
dist: {
files: {
'public/app.js': ['client/bootstrap.js']
},
options: {
shim: {
jquery: {
path: 'bower_components/jquery/jquery.js',
exports: '$'
},
underscore: {
path: 'bower_components/underscore/underscore.js',
exports: '_'
},
backbone: {
path: 'bower_components/backbone/backbone.js',
exports: 'Backbone',
depends: {
underscore: 'underscore'
}
},
'backbone.marionette': {
path: 'bower_components/backbone.marionette/lib/backbone.marionette.js',
exports: 'Marionette',
depends: {
jquery: '$',
backbone: 'Backbone',
underscore: '_'
}
}
},
transform: ['hbsfy'],
aliasMappings: [
{
cwd: 'client',
src: ['*.js'],
dest: 'lib',
}
],
alias: ["./client/homeLayout.js:HomeLayout"],
debug: true
}
},
specs: {
src: ['specs/*.js'],
dest: 'jasmine/specs_bundle.js',
options: {
external: ['client/*.js']
}
}
},
nodemon: {
dev: {}
},
watch: {
browserify: {
files: ["client/*.js", "client/*.hbs", "specs/*.js"],
tasks: ['browserify']
}
},
shell: {
mongo: {
command: '/usr/bin/mongodb/bin/mongod'
}
},
concurrent: {
target1: ['watch','nodemon','shell'],
options: {
logConcurrentOutput: true
}
}
});
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-concurrent');
grunt.loadNpmTasks('grunt-nodemon');
grunt.loadNpmTasks('grunt-shell');
grunt.registerTask('default', ['browserify','concurrent:target1']);
//grunt.registerTask('default', ['browserify','shell','nodemon','watch']);
grunt.event.on('watch', function(action, filepath, target) {
grunt.log.writeln(target + ': ' + filepath + ' has ' + action);
});
}