-
Notifications
You must be signed in to change notification settings - Fork 4
/
Gruntfile.js
85 lines (82 loc) · 2.84 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
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
version: '<%= pkg.version %>',
banner:
'/**\n' +
' * <%= pkg.description %>\n' +
' * v<%= pkg.version %>\n' +
' *\n' +
' * <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n' +
' * Distributed under <%= pkg.license %> license\n' +
' *\n' +
' * <%= pkg.homepage %>\n' +
' */\n\n'
},
less: {
dev: {
options: {
cleancss: false
},
files: {
'dist/css/simpletooltip.css': 'src/css/simpletooltip.less',
'demo/css/demo.css': 'demo/css/demo.less'
}
},
production: {
options: {
cleancss: true
},
files: {
'dist/css/simpletooltip.min.css': 'src/css/simpletooltip.less',
'demo/css/simpletooltip.min.css': 'src/css/simpletooltip.less',
'demo/css/demo.min.css': 'demo/css/demo.less'
}
}
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
files: ['Gruntfile.js', 'src/js/simpletooltip.js', 'test/**/*.js']
},
uglify: {
options: {
banner: '<%= meta.banner %>',
},
bundle: {
options: {
beautify: true,
compress: false
},
files: {
'dist/js/simpletooltip.js': ['src/js/simpletooltip.js'],
}
},
min: {
files: {
'dist/js/simpletooltip.min.js': ['src/js/simpletooltip.js'],
'demo/js/simpletooltip.min.js': ['src/js/simpletooltip.js'],
'demo/js/scrollspy.min.js': ['bower_components/bootstrap/js/scrollspy.js'],
'demo/js/affix.min.js': ['bower_components/bootstrap/js/affix.js']
}
}
},
watch: {
gruntfile: {
files: ['package.json', 'Gruntfile.js', 'src/js/simpletooltip.js'],
tasks: ['jshint', 'uglify']
},
css: {
files: ['src/css/*.less', 'demo/css/*.less'],
tasks: ['less']
}
}
});
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['less', 'jshint', 'uglify', 'watch']);
};