0de5dfc0fe
All checks were successful
build-docs
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>
45 lines
1013 B
JavaScript
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);
|