-
-
Notifications
You must be signed in to change notification settings - Fork 40
/
gulpfile.js
69 lines (62 loc) · 1.61 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
'use strict';
const gulp = require('gulp');
const rename = require('gulp-rename');
const concat = require('gulp-concat');
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, { sourcemaps: true })
.pipe(
postcss([
autoprefixer(),
sorting(sortOrder),
]),
)
.pipe(gulp.dest(paths.styles.css, { sourcemaps: './' }));
}
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',
], { sourcemaps: true })
.pipe(concat('stylesheet.css'))
.pipe(
postcss([
cssnano(),
]),
)
.pipe(rename({
suffix: '.min',
extname: '.css',
}))
.pipe(gulp.dest(paths.styles.css, { sourcemaps: './' }));
}
function watch() {
gulp.watch(paths.styles.src, styles);
}
exports.style = styles;
exports.minify = minify;
exports.watch = watch;
exports.default = gulp.series(styles, minify, watch);