gulp-onejs-build
A set of handy gulp tasks to build, test, and release your OneJS project.
Install the plugin through npm
npm install gulp-onejs-build --save-dev
Add it to your gulpfile.js and register all of the gulp tasks
var gulp = require('gulp');
var karma = require('karma').server;
var oneJsBuild = require('gulp-onejs-build');
oneJsBuild.gulpTasks.all({
gulp: gulp,
rootDir: __dirname,
karma: karma
});
Run gulp
at the command line and that's it! For a full listing of all tasks that are registered, run the standard gulp --tasks
!
As show in the example above, there are options that you can pass while registering your gulp tasks.
name | optional | description |
---|---|---|
gulp | false | Pass in your local gulp instance so the tasks are registered on the proper instance |
rootDir | false | The rootdir for your project, generally this is __dirname |
paths | true | If you want to override our path structure, you can do so. This is not recommended as OneJS has an existing, expected directory structure |
karma | false (for test) | Pass in your local karma instance so tests can be ran properly |
autoprefixerOptions | true | We use gulp-autoprefixer to help simplify our LESS/CSS, feel free to pass in your options to autoprefixer as defined by the module itself |
tscOptions | true | Options for gulp-typescript |
deps | true | A map of src globs to dest paths for the build process to copy over before build time |
gulpTaskOptions | true | A map of gulp task names to additional tasks that should be ran as pre-reqs to the gulp task |
You can register all, or just a subset of the available gulp tasks.
Imports all the tasks available: dev, test, and release.
Only imports the gulp tasks needed for development (everything that is in ./tasks/dev.js).
Imports the gulp tasks needed for testing (everything that is in ./tasks/test.js and ./tasks/dev.js).
Imports the gulp tasks needed for releasing/publishing to npm/bower (everything that is in ./tasks/release.js and ./tasks/dev.js).