forked from phpbb/phpbb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
74 lines (67 loc) · 1.69 KB
/
gulpfile.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
'use strict';
const gulp = require('gulp');
const rename = require('gulp-rename');
const sourcemaps = require('gulp-sourcemaps');
const concat = require('gulp-concat-css');
const postcss = require('gulp-postcss');
const autoprefixer = require('autoprefixer');
const cssnano = require('cssnano');
const sorting = require('postcss-sorting');
const sortOrder = require('./.postcss-sorting.json');
// Config
const paths = {
styles: {
src: './phpBB/styles/prosilver/theme/*.css',
css: './phpBB/styles/prosilver/theme/',
},
};
function styles() {
return gulp.src(paths.styles.src)
.pipe(sourcemaps.init())
.pipe(
postcss([
autoprefixer(),
sorting(sortOrder),
]),
)
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest(paths.styles.css));
}
function minify() {
return gulp.src([
paths.styles.css + 'normalize.css',
paths.styles.css + 'base.css',
paths.styles.css + 'utilities.css',
paths.styles.css + 'icons.css',
paths.styles.css + 'common.css',
paths.styles.css + 'buttons.css',
paths.styles.css + 'links.css',
paths.styles.css + 'mentions.css',
paths.styles.css + 'content.css',
paths.styles.css + 'cp.css',
paths.styles.css + 'forms.css',
paths.styles.css + 'colours.css',
paths.styles.css + 'responsive.css',
paths.styles.css + 'bidi.css',
])
.pipe(sourcemaps.init())
.pipe(concat('stylesheet.css'))
.pipe(
postcss([
cssnano(),
]),
)
.pipe(rename({
suffix: '.min',
extname: '.css',
}))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest(paths.styles.css));
}
function watch() {
gulp.watch(paths.styles.src, styles);
}
exports.style = styles;
exports.minify = minify;
exports.watch = watch;
exports.default = gulp.series(styles, minify, watch);