forked from danialfarid/ng-file-upload
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
106 lines (102 loc) · 2.47 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
module.exports = function(grunt) {
grunt.initConfig({
pkg : grunt.file.readJSON('package.json'),
copy : {
build : {
options : {
processContent : function(content, srcpath) {
return grunt.template.process(content);
}
},
files : [ {
expand : true,
cwd : 'demo/war/js/',
src : 'angular-file-upload*.js',
dest : 'dist/',
flatten : true,
filter : 'isFile'
}]
},
fileapi: {
files: [{
expand : true,
cwd : 'demo/war/js/',
src : 'FileAPI.flash.swf',
dest : 'dist/',
flatten : true,
filter : 'isFile'
}, {
expand : true,
cwd : 'demo/war/js/',
src : 'FileAPI.min.js',
dest : 'dist/',
flatten : true,
filter : 'isFile'
} ]
},
bower : {
files : [ {
expand : true,
cwd : 'dist/',
src : '*',
dest : '../angular-file-upload-bower/',
flatten : true,
filter : 'isFile'
}, {
expand : true,
cwd : 'dist/',
src : '*',
dest : '../angular-file-upload-shim-bower/',
flatten : true,
filter : 'isFile'
} ]
}
},
concat: {
dist: {
options: {
process: function(content, srcpath) {
return grunt.template.process(content);
}
},
files: {
'demo/war/js/angular-file-upload-all.js':
['demo/war/js/angular-file-upload.js',
'demo/war/js/angular-file-upload-shim.js']
}
}
},
uglify : {
options : {
banner : '/*! <%= pkg.version %> */\n'
},
build : {
files : [ {
'dist/angular-file-upload.min.js' : 'dist/angular-file-upload.js',
'dist/angular-file-upload-shim.min.js' : 'dist/angular-file-upload-shim.js',
'dist/angular-file-upload-all.min.js' : 'dist/angular-file-upload-all.js'
} ]
}
},
replace : {
version : {
src: ['nuget/Package.nuspec', '../angular-file-upload-bower/bower.json',
'../angular-file-upload-shim-bower/bower.json'
],
overwrite: true,
replacements: [{
from: /"version" *: *".*"/g,
to: '"version": "<%= pkg.version %>"'
}, {
from: /<version>.*<\/version>/g,
to: '<version><%= pkg.version %></version>'
}]
}
}
});
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-text-replace');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.registerTask('default', [ 'concat:dist', 'copy:build', 'uglify', 'copy:fileapi', 'copy:bower', 'replace:version' ]);
};