forked from viewflow/django-material
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.babel.js
118 lines (95 loc) · 2.77 KB
/
gulpfile.babel.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
import autoprefixer from 'autoprefixer';
import gulp from 'gulp';
import postcss from 'gulp-postcss';
import sass from 'gulp-sass';
var supported_browsers = [
'Chrome >= 50',
'Firefox >= 46',
'Explorer >= 11',
'Safari >= 9',
'ChromeAndroid >= 50',
'FirefoxAndroid >= 46',
];
gulp.task('material-icons.font', () => {
return gulp.src('./node_modules/material-design-icons/iconfont/*')
.pipe(gulp.dest('./material/static/material/fonts/material-design-icons/'));
});
gulp.task('roboto.font', () => {
return gulp.src('./node_modules/materialize-css/fonts/roboto/*')
.pipe(gulp.dest('./material/static/material/fonts/roboto/'));
});
gulp.task('materialize.js', () => {
return gulp.src('./node_modules/materialize-css/dist/js/materialize.js')
.pipe(gulp.dest('./material/static/material/js/'));
});
gulp.task('materialize.css', () => {
return gulp.src('./material/static/material/sass/*.scss')
.pipe(sass({
includePaths: './node_modules/'
}).on(
'error', sass.logError
))
.pipe(postcss([
autoprefixer({
browsers: supported_browsers
})
]))
.pipe(gulp.dest(
'./material/static/material/css/'
));
});
gulp.task('datatables.js', () => {
return gulp.src('./node_modules/datatables/media/js/jquery.dataTables.js')
.pipe(gulp.dest('./material/static/material/js/'));
});
gulp.task('datatables.fixedHeader.js', () => {
return gulp.src('./node_modules/datatables.net-fixedheader/js/dataTables.fixedHeader.js')
.pipe(gulp.dest('./material/static/material/js/'));
});
gulp.task('datatables.responsive.js', () => {
return gulp.src('./node_modules/datatables.net-responsive/js/dataTables.responsive.js')
.pipe(gulp.dest('./material/static/material/js/'));
});
gulp.task('frontend.css', () => {
return gulp.src('./material/frontend/static/material/frontend/sass/*.scss')
.pipe(sass({
includePaths: ['./node_modules/', './material/static/']
}).on(
'error', sass.logError
))
.pipe(postcss([
autoprefixer({
browsers: supported_browsers
})
]))
.pipe(gulp.dest(
'./material/frontend/static/material/frontend/css/'
));
});
gulp.task('admin.css', () => {
return gulp.src('./material/admin/static/material/admin/sass/*.scss')
.pipe(sass({
includePaths: ['./node_modules/', './material/static/']
}).on(
'error', sass.logError
))
.pipe(postcss([
autoprefixer({
browsers: supported_browsers
})
]))
.pipe(gulp.dest(
'./material/admin/static/material/admin/css/'
));
});
gulp.task("default", [
"materialize.js",
"materialize.css",
"roboto.font",
"material-icons.font",
"datatables.js",
"datatables.fixedHeader.js",
"datatables.responsive.js",
"frontend.css",
"admin.css",
]);