-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
156 lines (152 loc) · 6.12 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/* global module:false */
module.exports = function(grunt) {
grunt.initConfig({
app: grunt.file.readJSON('package.json'),
sass: {
dist: {
options: {
style: 'expanded'
},
files: {
'Resources/Public/Styles/backend.css': 'Resources/Private/Styles/backend.scss',
'Resources/Public/Styles/frontend.css': 'Resources/Private/Styles/frontend.scss',
'Resources/Public/Styles/Error.css': 'Resources/Private/Styles/Error.scss'
}
}
},
watch: {
css: {
files: ['Resources/Private/Styles/*.scss'],
tasks: ['sass', 'autoprefixer']
},
js: {
files: ['Resources/Private/Scripts/*.js'],
tasks: ['concat:core', 'uglify:core']
}
},
clean: ['Resources/Public/Vendor/'],
copy: {
vendor: {
files: [{
expand: true,
cwd: 'Resources/Private/Vendor/bootstrap/dist',
src: ['**'],
dest: 'Resources/Public/Vendor/bootstrap'
}, {
expand: true,
cwd: 'Resources/Private/Vendor/Clockpicker/dist',
src: ['bootstrap-clockpicker.css', 'bootstrap-clockpicker.js'],
dest: 'Resources/Public/Vendor/Clockpicker'
}, {
expand: true,
cwd: 'Resources/Private/Vendor/CSS3-animate-it',
src: ['css/*.css', 'js/*.js'],
dest: 'Resources/Public/Vendor/CSS3-animate-it'
}, {
expand: true,
cwd: 'Resources/Private/Vendor/Datepicker/dist',
src: ['**'],
dest: 'Resources/Public/Vendor/Datepicker'
}, {
expand: true,
cwd: 'Resources/Private/Vendor/Font-Awesome',
src: ['css/*.css', 'fonts/*'],
dest: 'Resources/Public/Vendor/Font-Awesome'
}, {
expand: true,
cwd: 'Resources/Private/Vendor/Magnific-Popup/dist',
src: ['*.css', '*.js'],
dest: 'Resources/Public/Vendor/Magnific-Popup'
}, {
expand: true,
cwd: 'Resources/Private/Vendor/socialshareprivacy',
src: ['lang/*', 'images/*', 'socialshareprivacy.css', 'jquery.socialshareprivacy.js'],
dest: 'Resources/Public/Vendor/socialshareprivacy'
}, {
expand: true,
cwd: 'Resources/Private/Vendor/rangeslider.js/dist',
src: ['*'],
dest: 'Resources/Public/Vendor/rangeslider.js'
}]
}
},
concat: {
vendor: {
src: ['Resources/Public/Vendor/bootstrap/js/bootstrap.js', 'Resources/Public/Vendor/Clockpicker/bootstrap-clockpicker.js', 'Resources/Public/Vendor/CSS3-animate-it/js/css3-animate-it.js', 'Resources/Public/Vendor/Datepicker/js/bootstrap-datepicker.js', 'Resources/Public/Vendor/Magnific-Popup/jquery.magnific-popup.js', 'Resources/Public/Vendor/socialshareprivacy/jquery.socialshareprivacy.js', 'Resources/Public/Vendor/rangeslider.js/rangeslider.js'],
dest: 'Resources/Public/Vendor/_vendor.js'
},
core: {
src: ['Resources/Private/Scripts/main.*.js', 'Resources/Private/Scripts/main.js'],
dest: 'Resources/Public/Scripts/main.js'
}
},
uglify: {
vendor: {
options: {
mangle: false,
sourceMap: true,
preserveComments: 'some'
},
files: {
'Resources/Public/Vendor/_vendor.min.js': ['Resources/Public/Vendor/_vendor.js']
}
},
core: {
options: {
mangle: false,
sourceMap: true,
preserveComments: 'some'
},
files: {
'Resources/Public/Scripts/main.min.js': ['Resources/Public/Scripts/main.js']
}
}
},
cssmin: {
options: {
relativeTo: 'Resources/Public/Vendor/',
target: 'Resources/Public/Vendor/_vendor.min.css'
},
target: {
files: {
'Resources/Public/Vendor/_vendor.min.css': ['Resources/Public/Vendor/_vendor.css']
}
}
},
css_url_relative: {
styles: {
options: {
staticRoot: 'Resources/Public/Vendor/'
},
files: [{
src: ['Resources/Public/Vendor/bootstrap/css/bootstrap.css', 'Resources/Public/Vendor/socialshareprivacy/socialshareprivacy.css', 'Resources/Public/Vendor/Clockpicker/bootstrap-clockpicker.css', 'Resources/Public/Vendor/CSS3-animate-it/css/animations.css', 'Resources/Public/Vendor/Datepicker/css/bootstrap-datepicker.css', 'Resources/Public/Vendor/Font-Awesome/css/font-awesome.css', 'Resources/Public/Vendor/Magnific-Popup/magnific-popup.css', 'Resources/Public/Vendor/rangeslider.js/rangeslider.css'],
dest: 'Resources/Public/Vendor/_vendor.css'
}]
}
},
jsbeautifier: {
files: ['Gruntfile.js', 'Resources/Private/Scripts/*.js'],
options: {
config: '.jsbeautifyrc'
}
},
autoprefixer: {
no_dest: {
src: ['Resources/Public/Styles/frontend.css', 'Resources/Public/Styles/backend.css']
}
}
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-css-url-relative');
grunt.loadNpmTasks('grunt-jsbeautifier');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.registerTask('default', ['sass', 'autoprefixer', 'concat:core', 'uglify:core', 'watch']);
grunt.registerTask('commit', ['jsbeautifier']);
grunt.registerTask('build', ['clean', 'copy', 'css_url_relative', 'cssmin', 'concat', 'uglify']);
};