Skip to content

Commit

Permalink
gulp check dist dir
Browse files Browse the repository at this point in the history
  • Loading branch information
planethouki committed Mar 23, 2024
1 parent d625755 commit 52fa599
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
const { parallel, src, dest } = require('gulp');
const { parallel, series, src, dest } = require('gulp');
const superstatic = require('superstatic');
const browserify = require('browserify');
const fs = require('fs');
const ejs = require('ejs');

function checkDistFolder(cb) {
fs.access('dist', fs.constants.F_OK, (err) => {
if (err) {
// distフォルダが存在しない場合は作成
fs.mkdirSync('dist');
}
cb();
});
}

function javascript(cb) {
const b = browserify({
ignoreMissing : true
Expand Down Expand Up @@ -49,6 +59,6 @@ function docsCss() {
}


exports.build = parallel(javascript, html, css);
exports.build = series(checkDistFolder, parallel(javascript, html, css));
exports.serve = serve;
exports.docs = parallel(docsJs, docsHtml, docsCss);

0 comments on commit 52fa599

Please sign in to comment.