-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgruntfile.js
More file actions
62 lines (53 loc) · 1.4 KB
/
Copy pathgruntfile.js
File metadata and controls
62 lines (53 loc) · 1.4 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
module.exports = init;
function init(grunt) {
var browserifyFile = 'dist/js/angular-upload.js';
var browserify = {
dev: {
src: ['src/js/angular-upload.module.js'],
dest: browserifyFile
}
};
var uglify = {
prod: {
options: { mangle: true, compress: true },
src: browserifyFile,
dest: 'dist/js/angular-upload.min.js'
}
};
var less = {
development: {
files: {
'./dist/css/angular-upload.css': './src/less/index.less'
}
},
};
var cssmin = {
target: {
files: {
'./dist/css/angular-upload.min.css': ['./dist/css/angular-upload.css']
}
}
}
var watch = {
scripts: {
files: ['src/**'],
tasks: ['browserify'],
option: {
spawn: false
}
}
};
grunt.initConfig({
browserify: browserify,
uglify: uglify,
less: less,
cssmin: cssmin,
watch: watch
});
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.registerTask('default', ['browserify', 'uglify', 'less', 'cssmin']);
}