-
Notifications
You must be signed in to change notification settings - Fork 287
/
Gruntfile.js
82 lines (65 loc) · 1.94 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
today: grunt.template.today("yyyy-mm-dd"),
banner: '/*! jQuery.Flipster, v<%= pkg.version %> (built <%= today %>) */\n',
autoprefix: new (require('less-plugin-autoprefix'))({browsers: ["last 3 versions", 'ie >= 9']}),
src: {
dir: 'src',
js: '<%= src.dir %>/jquery.flipster.js',
less: '<%= src.dir %>/**/*.less'
},
dist: {
dir: 'dist',
js: '<%= dist.dir %>/jquery.flipster.min.js',
css: '<%= dist.dir %>/jquery.flipster.css',
cssmin: '<%= dist.dir %>/jquery.flipster.min.css'
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.config('uglify',{
options: {
banner: '<%= banner %>',
},
dist: {
files: {
'<%= dist.js %>': ['<%= src.js %>']
}
}
});
grunt.loadNpmTasks('grunt-contrib-less');
grunt.config('less',{
full: {
options: {
banner: '<%= banner %>',
plugins: ['<%= autoprefix %>']
},
files: {
'<%= dist.css %>': ['<%= src.less %>']
}
},
minified: {
options: {
banner: '<%= banner %>',
plugins: ['<%= autoprefix %>'],
compress: true
},
files: {
'<%= dist.cssmin %>': ['<%= src.less %>']
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.config('watch',{
options: { debounceDelay: 250 },
scripts: {
files: '<%= src.js %>',
tasks: ['uglify']
},
less: {
files: '<%= src.less %>',
tasks: ['less']
},
});
grunt.registerTask('default', ['uglify', 'less']);
};