-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
95 lines (93 loc) · 2.87 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
module.exports = function(grunt) {
grunt.initConfig({
uglify: {
options: {
mangle: true
},
slyckSlide: {
files: {
'dist/slyckSlide.min.js': ['src/js/slyckSlide.js'],
}
}
},
less: {
development: {
options: {
paths: ['src/less']
},
files: {
'dist/slyckSlide.css': 'src/less/slyckSlide.less'
}
},
production: {
options: {
paths: ['src/less'],
},
files: {
'dist/slyckSlide.css': 'src/less/slyckSlide.less'
}
}
},
autoprefixer: {
options: {
//Browsers to prefix for
browsers: ['last 2 version', 'ie 8', 'ie 9', 'Opera 12.1']
},
dist: {
files: {
'dist/slyckSlide.css': 'dist/slyckSlide.css' // destination file and source file
}
}
},
watch: {
scripts: {
files: ['src/js/**/*.js', 'src/less/**/*.less', 'examples/**/*.html'],
tasks: ['less:development', 'autoprefixer', 'copy'],
options: {
spawn: false,
},
},
},
cssmin: {
compress: {
files: {
'dist/slyckSlide.min.css': ['dist/slyckSlide.css']
}
}
},
copy: {
main: {
expand: true,
cwd: 'src/js',
src: '**',
dest: 'dist/',
},
},
bump: {
options: {
files: ['package.json'],
updateConfigs: [],
commit: false,
createTag: true,
tagName: 'v%VERSION%',
tagMessage: 'Version %VERSION%',
push: true,
pushTo: 'origin',
gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d',
globalReplace: false,
prereleaseName: "pre",
metadata: '',
regExp: false
}
},
});
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-bump');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.registerTask('default', ['less:development', 'autoprefixer', 'copy', 'watch']);
grunt.registerTask('build', ['uglify', 'less:production', 'autoprefixer', 'cssmin', 'copy']);
}