forked from voidberg-archive/ngCompletr
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
executable file
·91 lines (87 loc) · 2.21 KB
/
Gruntfile.js
File metadata and controls
executable file
·91 lines (87 loc) · 2.21 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
'use strict';
module.exports = function( grunt ) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
pkg : grunt.file.readJSON('package.json'),
banner : '/*\n * <%= pkg.name %> <%= pkg.version %>\n * <%= pkg.homepage %>\n *\n * Built on <%= grunt.template.today("dd-mm-yyyy") %>\n *\n * Licensed under the <%= pkg.license %> license\n */\n',
uglify : {
options: {
banner: '<%= banner %>'
},
production : {
src: [ 'src/ngCompletr.js' ],
dest: 'dist/ngCompletr.min.<%= pkg.version %>.js'
}
},
copy : {
production : {
files : [
{ src: 'src/ngCompletr.js', dest : 'dist/ngCompletr.<%= pkg.version %>.js' },
{ src: 'src/ngCompletr.css', dest : 'dist/ngCompletr.<%= pkg.version %>.css' }
]
}
},
clean: {
dist: 'dist/*'
},
cssmin: {
production: {
options: {
banner: '<%= banner %>'
},
files: {
'dist/ngCompletr.min.<%= pkg.version %>.css': ['src/ngCompletr.css']
}
}
},
jsvalidate: {
options:{
globals: {},
esprimaOptions: {},
verbose: false
},
targetName:{
files:{
src: [
'Gruntfile.js',
'src/*.js'
]
}
}
},
karma: {
options: {
configFile: 'test/karma.conf.js',
browsers: ['PhantomJS']
},
unit: {
singleRun: true
},
watch: {
autoWatch: true
},
server: {
background: true
}
},
jshint: {
options: {
jshintrc: '.jshintrc',
reporter: require('jshint-stylish')
},
all: [
'Gruntfile.js',
'src/*.js'
]
},
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-jsvalidate');
grunt.registerTask('default', ['build']);
grunt.registerTask('test', ['karma:unit']);
grunt.registerTask('validate', ['jsvalidate', 'jshint']);
grunt.registerTask('build', ['clean', 'validate', 'karma:unit', 'copy', 'cssmin' ,'uglify']);
};