This repository has been archived by the owner on Feb 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathGruntfile.js
115 lines (105 loc) · 3.73 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
module.exports = function(grunt) {
// load time-grunt and all grunt plugins found in the package.json
require( 'load-grunt-tasks' )( grunt );
grunt.initConfig({
// Copy bower files
copy: {
main: {
files: [
{
expand: true,
src: ['bower_components/select2/*.*'],
dest: 'application/site/public/theme/muhimu/components/select2',
flatten: true
},
]
},
},
// Sass
sass: {
dist: {
files: {
'application/site/public/theme/muhimu/css/default.css': 'application/site/public/theme/muhimu/css/default.scss',
'application/site/public/theme/muhimu/css/fonts.css': 'application/site/public/theme/muhimu/css/fonts.scss',
'application/site/public/theme/muhimu/css/ie.css': 'application/site/public/theme/muhimu/css/ie.scss',
'application/site/public/theme/muhimu/css/select2.css': 'application/site/public/theme/muhimu/css/select2.scss'
}
}
},
// Autoprefixer
autoprefixer: {
options: {
browsers: ['last 2 versions', 'ie 10']
},
files: {
expand: true,
flatten: true,
src: 'application/site/public/theme/muhimu/css/*.css',
dest: 'application/site/public/theme/muhimu/css/'
}
},
// Uglify
uglify: {
options: {
soureMap: true
},
build: {
files: {
'application/site/public/theme/muhimu/js/jquery.js': [
'bower_components/jquery/dist/jquery.min.js'
]
}
}
},
// CSSmin
cssmin: {
options: {
roundingPrecision: -1,
level: 2
},
site: {
files: {
'application/site/public/theme/muhimu/css/default.css': 'application/site/public/theme/muhimu/css/default.css',
'application/site/public/theme/muhimu/css/ie.css': 'application/site/public/theme/muhimu/css/ie.css',
'application/site/public/theme/muhimu/css/fonts.css': 'application/site/public/theme/muhimu/css/fonts.css',
'application/site/public/theme/muhimu/css/select2.css': 'application/site/public/theme/muhimu/css/select2.css'
}
}
},
browserSync: {
dev: {
bsFiles: {
src : 'application/site/public/theme/muhimu/css/default.css'
},
options: {
proxy: "police.dev",
port: 7654, // POLI on phone keypad
watchTask: true, // < VERY important
notify: false
}
}
},
// Watch
watch: {
css: {
files: '**/*.scss',
tasks: ['sass', 'cssmin', 'autoprefixer'],
options: {
interrupt: false,
atBegin: true
}
},
uglify: {
files: [
// 'application/site/public/theme/wepo/js/*.js'
],
tasks: ['uglify'],
options: {
interrupt: false,
atBegin: true
}
}
}
});
grunt.registerTask('default', ['uglify', 'copy', 'browserSync', 'watch']);
};