0.3.1 • Published 8 years ago
gcsj v0.3.1
GCSJ: Predefined Gulp-Tasks for Coffeescrip, Sass, Jade environments with Nodemon for CoffeeScript-Backend
Installation
Download and install the package via:
node install --save-dev gcsj
Create a gulpfile.js
in your project directory with following content:
var gulp = require('gulp'),
conf = require('./conf/gulp.json');
gulp.tasks = require('gcsj')(conf);
Sample configuration
As you can see in the previous example this package requires a config file. This config file could have the following structure:
{
"run": [],
"clean": "public/**/*",
"components": {
"src": "src/client/**/*.coffee",
"dest": "public/js/"
},
"libs": {
"src": [
"bower_components/angular/angular.js",
"bower_components/angular-route/angular-route.js",
"bower_components/angular-compass/js/angular-compass.js",
"bower_components/angular-resource/angular-resource.js",
"bower_components/angular-bootstrap/ui-bootstrap-tpls.js"
],
"dest": "public/js/"
},
"views": {
"src": "src/client/index.jade",
"include": "src/client/*/**/*.jade",
"dest": "public/"
},
"css": {
"src": "src/client/assets/css/styles.sass",
"dest": "public/css/"
},
"copy": {
"bower_components/bootstrap-sass/assets/fonts/bootstrap/*": "public/fonts/"
},
"nodemon": {
"script": "src/server/server.coffee",
"watch": [
"conf/*",
"src/server/server.coffee"
],
"env": {
"NODE_ENV": "development"
}
},
"browserSync": {
"proxy": "localhost:3000",
"port": 3001,
"files": [
"public/**/*"
]
}
}
Predefined Gulp-Tasks
- build
- transpiles sources
- concatenates js-libs
- moves resulting sources to destination folder e.g.
public
- watch
- runs build task
- runs shell scripts (optional)
- runs browser-sync
- runs nodemon (optional)
- watches source files for changes
- transpiles sources
- reloads browser
- nodemon
- todo..
- releaseBower
- todo..
- releaseNPM
- todo..
- releaseGHPages
- todo..
Known issues
- Some tasks may not terminate when there are no files to transpile
- Not well tested but the intention is clear, isn't it?