-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
103 lines (89 loc) · 1.82 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
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
// installs bower dependencies
auto_install: {
local: {}
},
// Serve
connect: {
server: {
options: {
port: 8100,
base: '.'
}
}
},
// concat lib js into dist js
concat: {
dist: {
src: [ 'lib/**/*.js'],
dest: 'dist/ng-slide-to-the-left.js'
}
},
// compile lib sass and move to dist sass
sass: {
dist: {
files: {
'dist/ng-slide-to-the-left.css':'lib/scss/ng-slide-to-the-left.scss'
}
}
},
// concat bower css and lin css into dist
concat_css: {
options: {},
all: {
src: ["dist/ng-slide-to-the-left.css", "bower_components/_bower.css"],
dest: "dist/ng-slide-to-the-left.min.css"
}
},
// ugligy
uglify: {
my_target: {
files: {
'dist/ng-slide-to-the-left.min.js': ['dist/ng-slide-to-the-left.js']
}
}
},
// minify css
cssmin: {
target: {
files: [{
'dist/ng-slide-to-the-left.min.css': ['dist/ng-slide-to-the-left.css']
}]
}
},
// watch lib and auto build
watch: {
scripts: {
files: [
'lib/**/*.js',
'lib/**/*.html',
'lib/**/*.scss'
],
tasks: [ 'compile' ]
},
}
});
// start server and build files
grunt.registerTask('develop', [
'connect',
'watch'
]);
grunt.registerTask('bower', [
'bower_concat'
]);
// compile scripts
grunt.registerTask('compile', [
'concat',
'sass',
'concat_css',
'uglify',
'cssmin'
]);
// install bower and compile scripts
grunt.registerTask('default', [
'auto_install',
'compile'
]);
};