gulp-onejs-build
A set of handy gulp tasks to build, test, and release your OneJS project.
How to use
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 = ;var karma = server;var oneJsBuild = ; oneJsBuildgulpTasksall 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
!
Options
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 |
4 flavors of gulp tasks
You can register all, or just a subset of the available gulp tasks.
1. All
Imports all the tasks available: dev, test, and release.
2. Dev
Only imports the gulp tasks needed for development (everything that is in ./tasks/dev.js).
3. Test
Imports the gulp tasks needed for testing (everything that is in ./tasks/test.js and ./tasks/dev.js).
4. Release
Imports the gulp tasks needed for releasing/publishing to npm/bower (everything that is in ./tasks/release.js and ./tasks/dev.js).