forked from bundanining/robust-free-bootstrap-admin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
70 lines (56 loc) · 2.6 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
module.exports = function(grunt) {
'use strict';
var path = require('path');
global.myLayout = grunt.option('Layout'); // Jade layout name
global.myLayoutName = grunt.option('LayoutName'); // Created layout folder name
global.rtl = '';
//Suffix for rtl files includes in html
if (grunt.option('TextDirection') !== undefined) {
global.myTextDirection = grunt.option('TextDirection').toLowerCase(); // Text direction (Eg. LTR, RTL)
if (myTextDirection == 'rtl')
global.rtl = '-rtl';
}
else{
global.myTextDirection = '';
}
require('load-grunt-config')(grunt, {
// path to task.js files, defaults to grunt dir
configPath: path.join(process.cwd(), 'grunt-tasks'),
// auto grunt.initConfig
init: true,
// data passed into config. Can use with <%= test %>
data: {
pkg: grunt.file.readJSON('package.json'),
config: grunt.file.readJSON('config.json'),
//color: grunt.file.readYAML('color.yml'),
banner: '/*!\n' +
' * <%= pkg.name %> (<%= pkg.homepage %>)\n' +
' * Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n' +
' * Licensed under the <%= pkg.license %>\n' +
' */\n'
},
// can optionally pass options to load-grunt-tasks.
// If you set to false, it will disable auto loading tasks.
loadGruntTasks: {
pattern: 'grunt-*',
config: require('./package.json'),
scope: ['devDependencies', 'dependencies']
}
});
// Clean task.
grunt.registerTask('dist-clean', ['clean:css', 'clean:js']);
// JS distribution task.
grunt.registerTask('dist-js', ['clean:js', 'copy:js', 'uglify:min', 'notify:js']);
// CSS distribution task.
grunt.registerTask('sass-compile', ['sass:main', 'sass:core', 'sass:pages', 'sass:plugins', 'notify:css']);
grunt.registerTask('dist-css', ['clean:css', 'sass-compile', 'autoprefixer:css', 'csscomb:css', 'cssmin:css', 'notify:css']);
grunt.registerTask('dist-css-rtl', ['clean:css_rtl', 'sass-compile', 'rtlcss', 'autoprefixer:css_rtl', 'csscomb:css_rtl', 'cssmin:css_rtl', 'notify:css']);
// Full distribution task.
grunt.registerTask('dist', ['dist-js', 'dist-css', 'notify:all']);
// Watch jade & scss changes
grunt.registerTask('monitor', ['concurrent:monitor']);
// Start server
grunt.registerTask('server', ['browserSync', 'notify:server']);
//Default
grunt.registerTask('default', 'dist');
};