在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):hontas/gulp-task-loader开源软件地址(OpenSource Url):https://github.com/hontas/gulp-task-loader开源编程语言(OpenSource Language):JavaScript 99.0%开源软件介绍(OpenSource Introduction):Gulp Task Loader
Not actively maintainedBecause I rarely use gulp these days. Wanna take over? Tell me. Installnpm install gulp-task-loader --save-dev Use
You may create subfolders of tasks as well. Tasks in these folders will have their task name prefixed by the folder name. For example, if you have a task named ExamplesSimple task file// gulp-tasks/copy.js
module.exports = function() {
return gulp.src("src/**/*")
.pipe(gulp.dest("dist/**/*"));
}; // gulpfile.js
// Load all tasks from folder `gulp-tasks`
require('gulp-task-loader')();
// use it!
gulp.watch(someFiles, ['copy']); With dependencies// gulp-tasks/task-with-deps.js
module.exports = function() {
return gulp.src("src/**/*")
.pipe(gulp.dest("dist/**/*"));
};
module.exports.dependencies = ['copy']; Load tasks from another folderrequire('gulp-task-loader')('le-tasks-de-gulp'); Load tasks in CoffeeScriptrequire('coffee-script/register');
require('gulp-task-loader')({ exts: ['.coffee'] }); Load tasks in other extensionsrequire('gulp-task-loader')({ exts: ['.jscript'] }); Task contextEach task is called with a context object containing a reference to // gulpfile.js
var pkg = require('./package.json');
require('gulp-task-loader')({ pkg: pkg, dest: 'dist' });
// gulp-tasks/xxx.js
module.exports = function() {
return this.gulp.src(this.opts.pkg.main)
.pipe(this.gulp.dest(this.opts.dest));
}; Subtasks// gulp-tasks/copy/all.js
// gulp-tasks/copy/fonts.js
// gulpfile.js
gulp.watch(allFiles, ['copy:all']);
gulp.watch(someFiles, ['copy:fonts']); Given the files in folder copy - two tasks have been created. OptionsdirType Path to folder with gulp tasks extensionsType List of extensions to filter tasks by. Example: Testnpm test Changelog1.4.4
1.4.1
1.4.0
1.3.0
1.2.1
1.2.0
1.1.0
pre 1.1.0
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论