Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shnam7/gulp-build-manager
Easy to use, configurable gulp task manager
https://github.com/shnam7/gulp-build-manager
builder gulp
Last synced: about 22 hours ago
JSON representation
Easy to use, configurable gulp task manager
- Host: GitHub
- URL: https://github.com/shnam7/gulp-build-manager
- Owner: shnam7
- License: mit
- Created: 2017-03-19T01:26:57.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-10-28T03:54:00.000Z (over 1 year ago)
- Last Synced: 2025-01-20T13:08:51.601Z (24 days ago)
- Topics: builder, gulp
- Language: TypeScript
- Homepage:
- Size: 5.46 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Gulp Build Manager
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.
## Installation
```bash
npm i gulp-build-manager --save-dev
npm i gulp --save-dev
```## Documentation
Go to [Documentation](https://shnam7.github.io/gulp-build-manager)## Key features
- Quick and easy gulp task creation
- Watching, reloading, and cleaning with minimal efforts
- Rich run-time builder API for user build actions
- Sync and async control for tasks, build actions, and gulp streams for flushing.
- Automatic NPM module installation
- Small to large scale project support using modular configuration
- Pre-defined Buildt-in builders and extensions
- Custom builders and extension support## What's new in version 4
- New architecture for better performance and easier interface
- Improved promise handling for better synchronization in build processes
- Multiple, modular build projects support
- Enhanced watching and reloading
- Rich runtime builder API for easier build routine development and customization## Automatic mudule installation
### Using gulpfile.js
```js
const gbm = require('gulp-build-manager');
gbm.setNpmOptions({autoInstall: true, installOptions: '--no-save'});
```### Using command line
```sh
npx gulp --npm-auto # default npm install option is '--save-dev'
```Refer to [Getting Started](docs/contents/01-getting-started.md) page for more information.
## Quick example: gulpfile.js
```js
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:
- scss: sass transpiler
- babel: ES6 transpiler using babel
- @build: main task running 'scss' and 'babel' in parallel
- @clean: clean task (default name is @clean)
- @watch: Full featured watch task with reloading using browser-sync (default name is @watch)## Easier way using built-in builders: gulpfile.js
```js
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](examples)** directory for more working examples.
![]()
Copyright © 2017, under MIT