1
0
mirror of https://github.com/tabler/tabler.git synced 2025-12-21 17:34:25 +04:00

site build fixes

This commit is contained in:
codecalm
2020-11-12 14:21:59 +01:00
parent af7d9d6648
commit cb0f68bc34
8 changed files with 29 additions and 19 deletions

View File

@@ -20,9 +20,12 @@ const gulp = require('gulp'),
fs = require('fs'),
path = require('path'),
YAML = require('yaml'),
yargs = require('yargs/yargs'),
cp = require('child_process'),
pkg = require('./package.json'),
year = new Date().getFullYear();
year = new Date().getFullYear(),
argv = yargs(process.argv).argv;
let BUILD = false,
distDir = './.tmp',
@@ -233,7 +236,13 @@ gulp.task('watch-jekyll', (cb) => {
*/
gulp.task('build-jekyll', (cb) => {
var env = Object.create(process.env);
env.JEKYLL_ENV = 'production';
if(argv.preview) {
env.JEKYLL_ENV = 'preview';
}
else {
env.JEKYLL_ENV = 'production';
}
return spawn('bundle', ['exec', 'jekyll', 'build', '--destination', demoDir, '--trace'], { env: env, stdio: 'inherit' })
.on('close', cb);