-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathgruntfile.js
133 lines (127 loc) · 4.04 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
module.exports = function(grunt) {
// 1. All configuration goes here
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
banner: '\n /* \n * PikadayResponsive \n * A responsive datepicker built on top of Pikaday. It shows the native datepicker on mobile devices and a nice JS-picker on desktop. \n * \n * @author: Francesco Novy \n * @licence: MIT <http://www.opensource.org/licenses/mit-license.php> \n * @link https://github.com/mydea/PikadayResponsive \n * @copyright: (c) <%= grunt.template.today("yyyy") %> \n * @version: <%= pkg.version %> \n */ \n\n',
modernizr: {
dist: {
'dest': 'dist/dependencies/pikaday-responsive-modernizr.js',
'tests': [
'inputtypes',
'touchevents'
],
'options': [
'setClasses'
],
'crawl': false,
'uglify': true
}
},
cssmin: {
minify: {
files: {
'dist/pikaday-responsive.min.css': ['dist/pikaday-responsive.css'],
'dist/pikaday-package.min.css': ['dist/pikaday-package.css'],
'dist/dependencies/pikaday.min.css': ['dist/dependencies/pikaday.css']
}
}
},
uglify: {
options: {
mangle: false
},
pikadayResponsive: {
options: {
banner: '<%= banner %>'
},
files: {
'dist/pikaday-responsive.min.js': ['dist/pikaday-responsive.js'],
'dist/pikaday-package.min.js': ['dist/pikaday-package.js']
}
},
vendor: {
files: {
'dist/pikaday-responsive.min.js': ['dist/pikaday-responsive.js'],
'dist/dependencies/pikaday.min.js': ['dist/dependencies/pikaday.js']
}
}
},
concat: {
lib: {
options: {
banner: '<%= banner %>'
},
src: ['src/pikaday-responsive.js'],
dest: 'dist/pikaday-responsive.js'
},
dependencies: {
files: {
'dist/dependencies/pikaday.js': ['bower_components/pikaday/pikaday.js'],
'dist/dependencies/pikaday.css': ['bower_components/pikaday/css/pikaday.css'],
'dist/dependencies/moment.js': ['bower_components/momentjs/moment.js'],
'dist/dependencies/moment.min.js': ['bower_components/momentjs/min/moment.min.js'],
'dist/dependencies/jquery.min.js': ['bower_components/jquery/dist/jquery.min.js']
}
},
app: {
options: {
banner: '<%= banner %>'
},
src: ['dist/dependencies/moment.js', 'dist/dependencies/pikaday.js', 'dist/pikaday-responsive.js'],
dest: 'dist/pikaday-package.js'
},
css: {
src: ['dist/dependencies/pikaday.css', 'dist/pikaday-responsive.css'],
dest: 'dist/pikaday-package.css'
}
},
sass: {
dist: {
options: {
style: 'expanded',
sourcemap: 'none'
},
files: {
'dist/pikaday-responsive.css': 'src/css/scss/pikaday-responsive.scss'
}
}
},
'bower-install-simple': {
options: {
color: true
},
'prod': {
options: {
production: true
}
},
'dev': {
options: {
production: false
}
}
},
'bower-update': {
options: {
pickAll: true,
filter: function(package, options) {
if (package.name.indexOf('jquery') === 0) {
return false
}
return true
},
rangeChar: '~'
}
}
});
// 3. Where we tell Grunt we plan to use this plug-in.
grunt.loadNpmTasks('grunt-modernizr');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-bower-install-simple');
grunt.loadNpmTasks('grunt-bower-update');
// 4. Where we tell Grunt what to do when we type 'grunt' into the terminal.
grunt.registerTask('default', ['bower-update', 'bower-install-simple:prod', 'sass', 'concat', 'uglify', 'cssmin', 'modernizr']);
};