1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-16 13:48:58 +01:00
php-phpbb/gulpfile.js
2024-05-07 21:02:28 +02:00

70 lines
1.6 KiB
JavaScript

'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);