forked from mautic/mautic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
90 lines (77 loc) · 2.29 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
'use strict';
module.exports = function(grunt) {
// Load grunt tasks automatically
require('load-grunt-tasks')(grunt);
// Time how long tasks take. Can help when optimizing build times
require('time-grunt')(grunt);
// Define the configuration for all the tasks
grunt.initConfig({
// mautic assets dir path
mautic: {
// configurable paths
coreBundleAssets: 'app/bundles/CoreBundle/Assets',
rootAssets: 'media'
},
// Watches files for changes and runs tasks based on the changed files
watch: {
less: {
files: ['<%= mautic.coreBundleAssets %>/css/**/*.less'],
tasks: ['less', /*'autoprefixer',*/ 'copy', 'cssmin']
}
},
// Compile LESS files to CSS
less: {
coreBundleAssets: {
files: {
// mautic app
'<%= mautic.coreBundleAssets %>/css/1.bootstrap.css': '<%= mautic.coreBundleAssets %>/css/1.bootstrap.less',
'<%= mautic.coreBundleAssets %>/css/2.app.css': '<%= mautic.coreBundleAssets %>/css/2.app.less',
// font awesome
'<%= mautic.rootAssets %>/css/font-awesome.css': '<%= mautic.coreBundleAssets %>/css/font-awesome/less/font-awesome.less',
// libraries
'<%= mautic.coreBundleAssets %>/css/libraries/1.typeahead.css': '<%= mautic.coreBundleAssets %>/css/libraries/1.typeahead.less'
}
}
},
// Add vendor prefixed styles
autoprefixer: {
options: {
browsers: ['last 2 version', 'ie 9']
},
coreBundleAssets: {
files: [{
expand: true,
cwd: '<%= mautic.coreBundleAssets %>/css/',
src: '{,*/}*.css',
dest: '<%= mautic.coreBundleAssets %>/css/'
}]
}
},
// Copies files
copy: {
fontAwesome: {
files: [{
expand: true,
cwd: '<%= mautic.coreBundleAssets %>/css/font-awesome',
dest: '<%= mautic.rootAssets %>',
src: ['fonts/**/*']
}]
}
},
// minify css
cssmin: {
fontAwesome: {
files: {
'<%= mautic.rootAssets %>/css/font-awesome.min.css': '<%= mautic.rootAssets %>/css/font-awesome.css'
}
}
}
});
grunt.registerTask('compile-less', [
'less',
//'autoprefixer',
'copy',
'cssmin',
'watch'
]);
};