-
Notifications
You must be signed in to change notification settings - Fork 25
/
Gruntfile.js
87 lines (83 loc) · 2.13 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
var srcFiles = [
'src/core.js',
'src/directives/dndDraggable.js',
'src/directives/dndDroppable.js',
'src/directives/dndRotatable.js',
'src/directives/dndResizable.js',
'src/directives/dndSortable.js',
'src/directives/dndSelectable.js',
'src/directives/dndRect.js',
'src/directives/dndModel.js',
'src/directives/dndLassoArea.js',
'src/directives/dndFittext.js',
'src/directives/dndKeyModel.js',
'src/directives/dndContainment.js',
'src/services/dndKey.js',
'src/services/dndLasso.js',
'src/services/EventEmitter.js'
];
module.exports = function (grunt) {
grunt.initConfig({
concat: {
options: {
separator: ';\n\n',
},
dist: {
src: srcFiles,
dest: 'dist/angular-dnd.js',
},
},
wrap: {
basic: {
src: ['dist/angular-dnd.js'],
dest: 'dist/angular-dnd.js',
options: {
wrapper: [
';(function(angular, undefined, window, document){\n',
'\n})(angular, undefined, window, document);'
]
}
}
},
uglify: {
build: {
src: 'dist/angular-dnd.js',
dest: 'dist/angular-dnd.min.js'
}
},
watch: {
files: srcFiles,
tasks: [
"concat",
"wrap",
"uglify"
]
},
connect: {
def: {
options: {
port: 3000,
}
},
},
});
function loadNpmTasks(tasks) {
tasks.forEach(function (task, i) {
grunt.loadNpmTasks(task);
});
}
loadNpmTasks([
'grunt-contrib-uglify',
'grunt-wrap',
'grunt-contrib-concat',
'grunt-contrib-connect',
'grunt-contrib-watch',
]);
grunt.registerTask('default', [
"concat",
"wrap",
"uglify",
"connect",
'watch'
]);
};