forked from mbenford/ngTagsInput
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
129 lines (116 loc) · 3.86 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
'use strict';
module.exports = function(grunt) {
function loadConfig(path) {
var glob = require('glob'),
object = {};
glob.sync('*', { cwd: path }).forEach(function(option) {
var key = option.replace(/\.js$/,''),
data = require(path + option);
object[key] = typeof data === 'function' ? data(grunt) : data;
});
return object;
}
var config = {
pkg: grunt.file.readJSON('package.json'),
bowerDirectory: 'ngTagsInput',
bowerFile: '<%= bowerDirectory %>/bower.json',
files: {
js: {
src: [
'src/constants.js',
'src/init.js',
'src/tags-input.js',
'src/tag-item.js',
'src/auto-complete.js',
'src/auto-complete-match.js',
'src/transclude-append.js',
'src/autosize.js',
'src/bind-attrs.js',
'src/configuration.js',
'src/util.js'
],
out: 'build/<%= pkg.name %>.js',
outMin: 'build/<%= pkg.name %>.min.js'
},
css: {
main: {
src: 'scss/main.scss',
out: 'build/<%= pkg.name %>.css',
outMin: 'build/<%= pkg.name %>.min.css'
},
bootstrap: {
src: 'scss/bootstrap/main.scss',
out: 'build/<%= pkg.name %>.bootstrap.css',
outMin: 'build/<%= pkg.name %>.bootstrap.min.css'
}
},
html: {
src: [
'templates/tags-input.html',
'templates/tag-item.html',
'templates/auto-complete.html',
'templates/auto-complete-match.html'
],
out: 'tmp/templates.js'
},
zip: {
unminified: 'build/<%= pkg.name %>.zip',
minified: 'build/<%= pkg.name %>.min.zip'
},
tgz: {
npm: 'build/<%= pkg.name %>.tgz'
},
spec: {
src: 'test/*.spec.js'
}
},
banners: {
unminified: '/*!\n' +
' * <%= pkg.prettyName %> v<%= pkg.version %>\n' +
' * <%= pkg.homepage %>\n' +
' *\n' +
' * Copyright (c) 2013-<%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n' +
' * License: <%= pkg.license %>\n' +
' *\n' +
' * Generated at <%= grunt.template.today("yyyy-mm-dd HH:MM:ss o") %>\n' +
' */',
minified: '/*! <%= pkg.prettyName %> v<%= pkg.version %> License: <%= pkg.license %> */'
}
};
grunt.util._.extend(config, loadConfig('./grunt/options/'));
grunt.initConfig(config);
require('load-grunt-tasks')(grunt);
grunt.loadTasks('grunt/tasks');
grunt.registerTask('test', ['jshint','karma:local']);
grunt.registerTask('coverage', ['test', 'open:coverage']);
grunt.registerTask('docs', ['clean:build', 'dgeni']);
grunt.registerTask('travis', [
'pack',
'compress',
'copy:travis',
'coveralls'
]);
grunt.registerTask('javascript-only', [
'test',
'ngtemplates',
'concat',
'ngAnnotate',
'uglify'
]);
grunt.registerTask('css-only', [
'sass',
'cssmin'
]);
grunt.registerTask('release', [
'pack',
'compress',
'changelog',
'replace:changelog',
'shell:git',
'copy:bower',
'update-bower-version',
'shell:git_bower',
'dgeni'
]);
grunt.registerTask('default', ['pack']);
};