Browse Source

Update npm gulpfile to match gulp4

pull/7005/head
Jack 4 years ago
parent
commit
0c60187687
1 changed files with 23 additions and 17 deletions
  1. 40
      tasks/config/npm/gulpfile.js

40
tasks/config/npm/gulpfile.js

@ -2,13 +2,13 @@
Set-up
*******************************/
var
let
gulp = require('gulp'),
// read user config to know what task to load
config = require('./tasks/config/user'),
// watch changes
// watch for file changes and build
watch = require('./tasks/watch'),
// build all files
@ -17,7 +17,7 @@ var
buildCSS = require('./tasks/build/css'),
buildAssets = require('./tasks/build/assets'),
// utility
// utility tasks
clean = require('./tasks/clean'),
version = require('./tasks/version'),
@ -30,24 +30,30 @@ var
watchRTL = require('./tasks/rtl/watch')
;
/* Simple Compatibility Fix for Gulp 3 Style Tasks */
gulp.start = function(name) {
let task = gulp.task(name);
if(task) {
task();
}
}
/*******************************
Tasks
*******************************/
gulp.task('default', false, [
'watch'
]);
gulp.task('default', watch);
gulp.task('watch', watch);
gulp.task('watch', 'Watch for site/theme changes', watch);
gulp.task('build', build);
gulp.task('build-javascript', buildJS);
gulp.task('build-css', buildCSS);
gulp.task('build-assets', buildAssets);
gulp.task('build', 'Builds all files from source', build);
gulp.task('build-javascript', 'Builds all javascript from source', buildJS);
gulp.task('build-css', 'Builds all css from source', buildCSS);
gulp.task('build-assets', 'Copies all assets from source', buildAssets);
gulp.task('clean', clean);
gulp.task('version', version);
gulp.task('clean', 'Clean dist folder', clean);
gulp.task('version', 'Displays current version of Semantic', version);
/*--------------
Docs
@ -58,8 +64,8 @@ gulp.task('version', 'Displays current version of Semantic', version);
https://github.com/Semantic-Org/Semantic-UI-Docs/
*/
gulp.task('serve-docs', 'Serve file changes to SUI Docs', serveDocs);
gulp.task('build-docs', 'Build all files and add to SUI Docs', buildDocs);
gulp.task('serve-docs', serveDocs);
gulp.task('build-docs', buildDocs);
/*--------------
@ -67,6 +73,6 @@ gulp.task('build-docs', 'Build all files and add to SUI Docs', buildDocs);
---------------*/
if(config.rtl) {
gulp.task('watch-rtl', 'Watch files as RTL', watchRTL);
gulp.task('build-rtl', 'Build all files as RTL', buildRTL);
gulp.task('watch-rtl', watchRTL);
gulp.task('build-rtl', buildRTL);
}
Loading…
Cancel
Save