2019-12-07 10:41:13 +01:00
|
|
|
const { src, dest, parallel } = require('gulp');
|
|
|
|
const include = require('gulp-include');
|
|
|
|
const sass = require('gulp-sass');
|
|
|
|
|
|
|
|
sass.compiler = require('node-sass');
|
|
|
|
|
|
|
|
function html() {
|
2020-03-08 22:39:49 +01:00
|
|
|
return src('src/static/*.html')
|
2019-12-07 10:41:13 +01:00
|
|
|
.pipe(include())
|
2020-11-08 20:03:29 +01:00
|
|
|
.pipe(dest('tmp'))
|
2019-12-07 10:41:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function css() {
|
|
|
|
return src('src/scss/style.scss')
|
|
|
|
.pipe(sass().on('error', sass.logError))
|
2020-11-08 20:03:29 +01:00
|
|
|
.pipe(dest('tmp'))
|
2019-12-07 10:41:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function js() {
|
|
|
|
return src('src/js/*.js')
|
2020-11-08 20:03:29 +01:00
|
|
|
.pipe(dest('tmp/js'))
|
2019-12-07 10:41:13 +01:00
|
|
|
}
|
|
|
|
|
2020-01-05 00:10:32 +01:00
|
|
|
function htmladmin() {
|
2020-03-08 22:39:49 +01:00
|
|
|
return src('src/admin/*.html')
|
2020-01-05 00:10:32 +01:00
|
|
|
.pipe(include())
|
2020-11-08 20:03:29 +01:00
|
|
|
.pipe(dest('tmp/admin'))
|
2020-01-05 00:10:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function cssadmin() {
|
2020-03-08 22:39:49 +01:00
|
|
|
return src('src/admin/scss/style.scss')
|
2020-01-05 00:10:32 +01:00
|
|
|
.pipe(sass().on('error', sass.logError))
|
2020-11-08 20:03:29 +01:00
|
|
|
.pipe(dest('tmp/admin'))
|
2020-01-05 00:10:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function jsadmin() {
|
2020-03-08 22:39:49 +01:00
|
|
|
return src('src/admin/js/*.js')
|
2020-11-08 20:03:29 +01:00
|
|
|
.pipe(dest('tmp/admin/js'))
|
2020-01-05 00:10:32 +01:00
|
|
|
}
|
|
|
|
|
2019-12-07 10:41:13 +01:00
|
|
|
function dep() {
|
2020-11-08 20:00:30 +01:00
|
|
|
return src(['dep/**/*'])
|
2020-11-08 20:03:29 +01:00
|
|
|
.pipe(dest('tmp/dep'));
|
2019-12-07 10:41:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function assets() {
|
2020-11-08 20:00:30 +01:00
|
|
|
return src(['assets/**/*'])
|
2020-11-08 20:03:29 +01:00
|
|
|
.pipe(dest('tmp'));
|
2019-12-07 10:41:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
exports.html = html;
|
|
|
|
exports.css = css;
|
|
|
|
exports.js = js;
|
|
|
|
exports.dep = dep;
|
|
|
|
exports.assets = assets;
|
2020-01-05 00:10:32 +01:00
|
|
|
exports.default = parallel(html, css, js, dep, assets, htmladmin, cssadmin, jsadmin);
|