diff options
Diffstat (limited to 'gulpfile.js')
-rw-r--r-- | gulpfile.js | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/gulpfile.js b/gulpfile.js index 824a788..37a07c5 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,15 +1,18 @@ -var gulp = require('gulp'), +var changed = require('gulp-changed'), + gulp = require('gulp'), hljs = require('highlight.js'), md = require('jstransformer')(require('jstransformer-markdown-it')), minifyhtml = require('gulp-minify-html'), + minifyjs = require('gulp-minify'), notify = require('gulp-notify'), pug = require('gulp-pug-3'), sass = require('gulp-sass-next'); var config = { - mdPath: './resources/md', - pugPath: './resources/pug', + jsPath: './resources/js', + mdPath: './resources/md', + pugPath: './resources/pug', sassPath: './resources/sass', } @@ -64,6 +67,25 @@ function html() { .pipe(gulp.dest(dst)); } +function js() { + var src = [ + './node_modules/bootstrap-sass/assets/javascripts/bootstrap/collapse.js', + './node_modules/bootstrap-sass/assets/javascripts/bootstrap/transition.js', + './node_modules/jquery/dist/jquery.slim.min.js', + ]; + var dst = './build/assets/js'; + + return gulp.src(src) + .pipe(minifyjs({ + ext: { + min: '.min.js' + }, + ignoreFiles: ['*.min.js'], + noSource: true, + })) + .pipe(gulp.dest(dst)); +} + function img() { return gulp.src('./resources/img/*') .pipe(gulp.dest('./build/assets/img')); @@ -92,10 +114,11 @@ function watch() { exports.css = css; exports.html = html; exports.img = img; +exports.js = js; exports.pdf = pdf; exports.fonts = fonts; exports.watch = watch; -var build = gulp.parallel(css, html, img, pdf, fonts); +var build = gulp.parallel(css, html, img, js, pdf, fonts); gulp.task('build', build); gulp.task('default', build); |