forked from thorsten/phpMyFAQ
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
126 lines (122 loc) · 4.56 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
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Metadata.
meta: {
version: '3.0'
},
banner: '/*! phpMyFAQ v3.0 - http://www.phpmyfaq.de - Copyright (c) 2001 - 2014 Thorsten Rinne and phpMyFAQ Team */\n',
// Task configuration.
bower: {
install: {
// just run 'grunt bower:install' and you'll see files from your Bower packages in lib directory
}
},
concat: {
options: {
banner: '<%= banner %>',
stripBanners: true
},
dist: {
src: [
'components/jquery/jquery.js',
'components/bootstrap/js/tooltip.js',
'components/bootstrap/js/transition.js',
'components/bootstrap/js/alert.js',
'components/bootstrap/js/button.js',
'components/bootstrap/js/collapse.js',
'components/bootstrap/js/dropdown.js',
'components/bootstrap/js/modal.js',
'components/bootstrap/js/popover.js',
'components/bootstrap/js/tab.js',
'phpmyfaq/assets/js/autosave.js',
'phpmyfaq/assets/js/functions.js'
],
dest: 'phpmyfaq/assets/js/phpmyfaq.js'
}
},
uglify: {
options: {
banner: '<%= banner %>'
},
dist: {
src: '<%= concat.dist.dest %>',
dest: 'phpmyfaq/assets/js/phpmyfaq.min.js'
}
},
jshint: {
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
unused: true,
boss: true,
eqnull: true,
browser: true,
globals: {
"jQuery": true
}
},
gruntfile: {
src: 'Gruntfile.js'
},
beforeconcat: [
'phpmyfaq/assets/js/autosave.js',
'phpmyfaq/assets/js/functions.js'
]
},
less: {
development: {
files: {
"phpmyfaq/admin/assets/css/style.css": "phpmyfaq/admin/assets/less/style.less",
"phpmyfaq/admin/assets/css/style.rtl.css": "phpmyfaq/admin/assets/less/style.rtl.less",
"phpmyfaq/assets/template/default/css/style.css": "phpmyfaq/assets/template/default/less/style.less",
"phpmyfaq/assets/template/default/css/style.rtl.css": "phpmyfaq/assets/template/default/less/style.rtl.less"
}
}
},
cssmin: {
add_banner: {
options: {
banner: '<%= banner %>',
keepSpecialComments: 0
},
files: {
"phpmyfaq/admin/assets/css/style.css": "phpmyfaq/admin/assets/css/style.css",
"phpmyfaq/admin/assets/css/style.rtl.css": "phpmyfaq/admin/assets/css/style.rtl.css",
"phpmyfaq/assets/template/default/css/style.min.css": ["phpmyfaq/assets/template/default/css/style.css"],
"phpmyfaq/assets/template/default/css/style.rtl.min.css": ["phpmyfaq/assets/template/default/css/style.rtl.css"]
}
}
},
watch: {
gruntfile: {
files: '<%= jshint.gruntfile.src %>',
tasks: ['jshint:gruntfile']
},
lib_test: {
files: '<%= jshint.lib_test.src %>',
tasks: ['jshint:lib_test', 'qunit']
}
}
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-bower-task');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-csslint');
// Default task.
grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'less', 'cssmin']);
};