forked from select2/select2-bootstrap-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
executable file
·128 lines (118 loc) · 2.81 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
module.exports = function(grunt) {
// Load all grunt tasks.
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// Project configuration.
grunt.initConfig({
nodeunit: {
all: ['tests/*_test.js']
},
sass: {
options: {
style: 'expanded',
sourcemap: 'none',
// Increase Sass' default (5) precision to 9 to match Less output.
//
// @see https://github.com/twbs/bootstrap-sass#sass-number-precision
// @see https://github.com/sass/node-sass/issues/673#issue-57581701
// @see https://github.com/sass/sass/issues/1122
precision: 9
},
dist: {
files: {
'docs/css/select2-bootstrap.css': 'src/build.scss',
'dist/select2-bootstrap.css': 'src/build.scss'
}
},
test: {
files: {
'tmp/select2-bootstrap.css': 'src/build.scss'
}
}
},
cssmin: {
target: {
files: {
'dist/select2-bootstrap.min.css': 'dist/select2-bootstrap.css'
}
}
},
jshint: {
all: ['Gruntfile.js', '*.json']
},
bump: {
options: {
files: [
'package.json',
'bower.json'
],
push: false,
createTag: false
}
},
copy: {
main: {
files: [
{
src: 'bower_components/bootstrap/dist/css/bootstrap.min.css',
dest: 'docs/css/bootstrap.min.css',
expand: false
},
{
src: 'bower_components/bootstrap/dist/js/bootstrap.min.js',
dest: 'docs/js/bootstrap.min.js',
expand: false
},
{
src: 'bower_components/respond/dest/respond.min.js',
dest: 'docs/js/respond.min.js',
expand: false
},
{
cwd: 'bower_components/bootstrap/dist/fonts',
src: ['**/*'],
dest: 'docs/fonts',
expand: true
},
{
src: 'bower_components/anchor-js/anchor.min.js',
dest: 'docs/js/anchor.min.js',
expand: false
}
]
}
},
'gh-pages': {
options: {
base: 'docs/_site',
message: 'Update gh-pages.'
},
src: ['**/*']
},
jekyll: {
options: {
src: 'docs',
dest: 'docs/_site',
sourcemaps: false
},
build: {
d: null
},
serve: {
options: {
serve: true,
watch: true
}
}
},
watch: {
files: 'src/select2-bootstrap.scss',
tasks: ['sass'],
options: {
livereload: true
}
}
});
// Default tasks.
grunt.registerTask('build', ['sass', 'cssmin', 'copy', 'jekyll:build']);
grunt.registerTask('serve', ['jekyll:serve']);
};