forked from snapjay/ngCart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
72 lines (57 loc) · 1.82 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
// grunt build
// grunt karma:unit:start watch
// grunt karma:once
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
separator: ';'
},
dist: {
src: ['src/ngCart.js', 'src/ngCart.directives.js', 'src/ngCart.fulfilment.js'],
dest: "dist/ngCart.js"
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> v<%= pkg.version %> */\n <%= pkg.url %>'
},
dist: {
src: 'dist/ngCart.js',
dest: "dist/ngCart.min.js"
}
},
karma: {
unit: {
configFile: 'karma.conf.js',
background: true
},
once: {
configFile: 'karma.conf.js',
singleRun: true
},
travis: {
configFile: 'karma.conf.js',
singleRun: true,
browsers: ['PhantomJS']
}
},
watch: {
karma: {
files: ['src/**/*.js'],
tasks: ['karma:unit:run']
}
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-karma');
grunt.registerTask('build', ['concat', 'uglify']);
grunt.registerTask('devmode', ['karma:unit', 'watch']);
grunt.registerTask('testunit', ['karma:unit']);
grunt.registerTask('test', ['karma:travis']);
};