This repository has been archived by the owner on Sep 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathGruntfile.js
113 lines (102 loc) · 2.51 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
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
module.exports = function(grunt) {
'use strict';
var pkg = grunt.file.readJSON('package.json');
grunt.initConfig({
pkg: pkg,
'deps-ok': {
options: {
skipBower: true
},
dummy: {}
},
jshint: {
all: [
'ng-alertify.js'
],
specs: ['test/*-spec.js'],
options: {
jshintrc: '.jshintrc'
}
},
sync: {
all: {
options: {
sync: ['author', 'name', 'version',
'private', 'license', 'keywords', 'homepage'],
}
}
},
concat: {
options: {
banner: '/**\n' +
' <%= pkg.name %>@<%= pkg.version %>\n' +
' <%= pkg.description %>\n' +
' <%= pkg.author %>\n' +
' <%= pkg.homepage %>\n' +
'*/\n\n',
process: function(src, filepath) {
if (/\.css$/.test(filepath)) {
return '/* CSS ' + filepath + ' */\n' + src;
} else if (/ng-alertify\.js$/.test(filepath)) {
['name', 'description', 'version', 'author'].forEach(function (tag) {
src = src.replace('%%' + tag + '%%', pkg[tag]);
});
return src;
} else {
return src;
}
}
},
css: {
src: ['bower_components/alertify.js/themes/alertify.core.css',
'bower_components/alertify.js/themes/alertify.default.css'
],
dest: 'dist/ng-alertify.css'
},
js: {
src: ['bower_components/alertify.js/lib/alertify.js', 'ng-alertify.js'],
dest: 'dist/ng-alertify.js'
},
},
karma: {
unit: {
configFile: 'test/karma.conf.js'
}
},
watch: {
options: {
atBegin: true
},
all: {
files: ['*.js', 'test/*.js', 'package.json'],
tasks: ['jshint', 'concat', 'test']
}
},
'clean-console': {
all: {
options: {
url: 'index.html'
}
}
},
'gh-pages': {
options: {
base: '.'
},
src: [
'README.md',
'ng-alertify.js',
'index.html',
'node_modules/es5-shim/es5-shim.js',
'bower_components/angular/angular.js',
'dist/ng-alertify.js',
'dist/ng-alertify.css'
]
}
});
var plugins = require('matchdep').filterDev('grunt-*');
plugins.forEach(grunt.loadNpmTasks);
grunt.registerTask('test', ['karma']);
grunt.registerTask('default',
['nice-package', 'deps-ok', 'sync', 'jshint', 'concat', 'test', 'clean-console']);
};