This repository has been archived by the owner on Oct 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGruntfile.js
124 lines (117 loc) · 3.19 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
/*!
* Jquery UI Bootstrap theme Gruntfile
* http://dharapvj.github.io/jq-ui-makeover/
* Copyright 2013-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/dharapvj/jq-ui-makeover/blob/master/LICENSE)
*/
module.exports = function (grunt) {
'use strict';
// Force use of Unix newlines
grunt.util.linefeed = '\n';
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
banner: '/*!\n' +
' * JQuery UI Bootstrap v<%= pkg.version %> (<%= pkg.homepage %>)\n' +
' * Copyright 2015-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
' * Licensed under MIT (https://github.com/dharapvj/jq-ui-makeover/blob/master/LICENSE)\n' +
' */\n',
// Task configuration.
clean: {
dist: 'dist',
docs: 'docs/dist'
},
scsslint: {
options: {
config: 'src-scss/jq-ui-bootstrap/.scsslint.yml',
reporterOutput: 'scss-lint-report.xml'
},
src: ['src-scss/jq-ui-bootstrap/*.scss']
},
cssmin: {
options: {
// TODO: disable `zeroUnits` optimization once clean-css 3.2 is released
// and then simplify the fix for https://github.com/twbs/bootstrap/issues/14837 accordingly
compatibility: 'ie8',
keepSpecialComments: '*',
sourceMap: true,
noAdvanced: true
},
core: {
files: [
{
expand: true,
cwd: 'dist/css',
src: ['*.css', '!*.min.css'],
dest: 'dist/css',
ext: '.min.css'
}
]
},
docs: {
src: 'docs/assets/css/docs.min.css',
dest: 'docs/assets/css/docs.min.css'
}
},
autoprefixer: {
options: {
browsers: [
'Android 2.3',
'Android >= 4',
'Chrome >= 35',
'Firefox >= 31',
'Explorer >= 9',
'iOS >= 7',
'Opera >= 12',
'Safari >= 7.1'
]
},
core: {
options: {
map: true
},
src: 'dist/css/*.css'
},
docs: {
src: 'docs/assets/css/docs.min.css'
},
examples: {
expand: true,
cwd: 'docs/examples/',
src: ['**/*.css'],
dest: 'docs/examples/'
}
},
usebanner: {
options: {
position: 'top',
banner: '<%= banner %>'
},
files: {
src: 'dist/css/*.css'
}
},
csscomb: {
options: {
config: 'src-scss/jq-ui-bootstrap/.csscomb.json'
},
dist: {
expand: true,
cwd: 'dist/css/',
src: ['*.css', '!*.min.css'],
dest: 'dist/css/'
}
},
});
// These plugins provide necessary tasks.
require('load-grunt-tasks')(grunt, { scope: 'devDependencies',
// Exclude Sass compilers. We choose the one to load later on.
pattern: ['grunt-*', '!grunt-sass', '!grunt-contrib-sass'] });
require('time-grunt')(grunt);
// Default task.
grunt.registerTask('default', ['clean']);
grunt.registerTask('test-scss', ['scsslint']);
grunt.registerTask('dist-css', ['sass-compile', 'autoprefixer:core', 'usebanner', 'csscomb:dist', 'cssmin:core', 'cssmin:docs']);
require('./grunt/libsass.js')(grunt);
grunt.registerTask('sass-compile', ['sass:core']);
};