Easy to use, configurable gulp task manager
MIT License
Gulp Build Manager, gbm in short, is an easy to use, configuration based gulp task manager. Users can create gulp tasks with simple build configurations. At the same time, javascript can be used to customize and extend the configuration.
Focus on build actions, rather than environment setup.
npm i gulp-build-manager --save-dev
npm i gulp --save-dev
Go to Documentation
const gbm = require('gulp-build-manager');
gbm.setNpmOptions({autoInstall: true, installOptions: '--no-save'});
npx gulp <task-name> --npm-auto # default npm install option is '--save-dev'
Refer to Getting Started page for more information.
const gbm = require('gulp-build-manager');
const upath = require('upath')
const basePath = upath.relative(process.cwd(), __dirname);
const srcRoot = upath.join(basePath, 'assets');
const destRoot = upath.join(basePath, 'www');
const scss = {
buildName: 'scss',
builder: (rtb) => rtb.src().pipe(sass().on('error', sass.logError)).dest(),
src: upath.join(srcRoot, 'scss/**/*.scss'),
dest: upath.join(destRoot, 'css'),
}
const scripts = {
buildName: 'babel',
builder: (rtb) => rtb.src().pipe(require('gulp-babel')()).dest(),
src: upath.join(srcRoot, 'js/**/*.js'),
dest: upath.join(destRoot, 'js'),
}
const build = {
buildName: '@build',
triggers: gbm.parallel(scss, scripts),
clean: upath.join(destRoot, '{css,js}')
}
gbm.createProject(build)
.addWatcher({
watch: upath.join(destRoot, '**/*.html'),
browserSync: { server: destRoot }
})
.addCleaner()
This gulpfile will create a single project with 5 gulp tasks as following:
const gbm = require('gulp-build-manager');
const upath = require('upath')
const basePath = upath.relative(process.cwd(), __dirname);
const srcRoot = upath.join(basePath, 'assets');
const destRoot = upath.join(basePath, 'www');
const scss = {
buildName: 'GCSSBuilder',
src: upath.join(srcRoot, 'scss/**/*.scss'),
dest: upath.join(destRoot, 'css'),
}
const scripts = {
buildName: 'GJavaScriptBuilder',
src: upath.join(srcRoot, 'js/**/*.js'),
dest: upath.join(destRoot, 'js'),
}
const build = {
buildName: '@build',
triggers: gbm.parallel(scss, scripts),
clean: upath.join(destRoot, '{css,js}')
}
gbm.createProject(build)
.addWatcher({
watch: upath.join(destRoot, '**/*.html'),
browserSync: { server: destRoot }
})
.addCleaner()
Check examples directory for more working examples.