This repository has been archived on 2023-07-20. You can view files and clone it, but cannot push or open issues or pull requests.
theme/gulpfile.js
techknowlogick 0de5dfc0fe
All checks were successful
build-docs
Use Gitea Actions to build and publish theme (#123)
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-on: #123
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: Jason Song <i@wolfogre.com>
Co-authored-by: techknowlogick <techknowlogick@noreply.gitea.io>
Co-committed-by: techknowlogick <techknowlogick@noreply.gitea.io>
2023-03-07 20:06:40 +08:00

45 lines
1013 B
JavaScript

var gulp = require('gulp');
var sass = require('gulp-dart-sass');
var sourcemaps = require('gulp-sourcemaps');
var tar = require('gulp-tar-path');
var gzip = require('gulp-gzip');
var clean = require('gulp-clean');
var sources = [
'archetypes',
'i18n',
'layouts',
'static',
'DCO',
'LICENSE',
'README.md',
'theme.toml'
];
var build = function () {
return gulp.src('./src/main.scss')
.pipe(sourcemaps.init())
.pipe(sass().on('error', sass.logError))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('./static/styles'));
}
gulp.task('clean', function () {
return gulp.src(['dist', 'static/styles'], { allowEmpty: true })
.pipe(clean());
});
gulp.task('watch', function () {
return gulp.watch('./src/*.scss', build);
});
gulp.task('release', function () {
return gulp.src(sources)
.pipe(tar('main.tar'))
.pipe(gzip())
.pipe(gulp.dest('dist'))
});
gulp.task('build', build);
gulp.task('default', build);