gulp-starter-stylus
v0.1.1
Published
Gulp starter with common tasks and scenarios
Downloads
3
Readme
gulp-starter-stylus
Starter Gulp + Browserify project with examples of how to accomplish some common tasks and workflows. The code is mostly based on the gulp-starter project, currently my only changes are to replace the use of SASS with Stylus due to personal preferences :)
Read the original blog post for more context, and check out the Wiki for some good background knowledge.
Includes the following tools, tasks, and workflows:
- Browserify (with browserify-shim)
- Watchify (caching version of browserify for super fast rebuilds)
- Stylus (with the Nib extension library, source maps and autoprefixer)
- CoffeeScript (with source maps!)
- jQuery (from npm)
- Backbone (from npm)
- Handlebars (as a backbone dependency)
- BrowserSync for live reloading and a static server
- Image optimization
- Error Notifications in Notification Center
- Non common-js vendor code (like a jQuery plugin)
Installation
If you've never used Node or npm before, you'll need to install Node. If you use homebrew, do:
brew install node
Otherwise, you can download and install from here.
Gulp must be installed globally in order to use the command line tools. You may need to use sudo
npm install -g gulp
Alternatively, you can run the version of gulp installed local to the project instead with
./node_modules/.bin/gulp
Install npm dependencies
npm install
This runs through all dependencies listed in package.json
and downloads them
to a node_modules
folder in your project directory.
Run gulp and be amazed.
gulp
This will run the default
gulp task defined in gulp/tasks/default.js
, which does the following:
- Run 'watch', which has 2 task dependencies,
['setWatch', 'browserSync']
setWatch
sets a variable that tells the browserify task whether or not to use watchify.browserSync
hasbuild
as a task dependecy, so that all your assets will be processed before browserSync tries to serve them to you in the browser.build
includes the following tasks:['browserify', 'stylus', 'images', 'markup']
Configuration
All paths and plugin settings have been abstracted into a centralized config object in gulp/config.js
. Adapt the paths and settings to the structure and needs of your project.