Weekend project to create a process to help me get up to speed as quickly as possible on new projects using Gulp.
Firestarter has 3 parts:
gulp
build script for optimization things just like I like them for new Angular SPAs.As a pre-requisite, yeoman
is required and if you don't already, install it globally:
npm install -g yo
If you'd like to get to know Yeoman better and meet some of his friends, Gulp and Bower, check out the complete Getting Started Guide.
To install the firestarter
generator, from your terminal, run:
npm install -g generator-firestarter
If you're wanting to contribute to development of this package, you can alternatively install it like so:
git clone https://github.com/CWSpear/firestarter.git firestarter
cd firestarter
npm link
npm link
will link this local package to your global npm
packages.
Finally, initiate the generator:
yo firestarter
npm install
bower install
gulp
gulp production
# aliases for the same thing
gulp build
gulp prod
gulp
# aliases for the same thing
gulp dev
gulp development
# just add the --watch flag to any command
gulp [production] --watch
gulp serve [--port="port"] # just serves the app
# or
gulp --serve[="port"] # runs dev task + serves (define optional port)
# (--port flag overrides --serve flag)
This particular project was built with an AngularJS Single Page Application (SPA), and these tasks are built with that goal in mind:
scss
→ css
(minifies if using production task)autoprefixer
on compiled css
babeljs
js
and revisions files (for cachebusting)bower
components (both js
and css
) (resolving dependencies to determine order)gulp-plumber
to make sure watch
doesn't break everythingComing Eventually...
babeljs
, as well as clean up various little things. (Removed undocumented, rarely used --install
flag support.)gulp-angular-filesorter
to make it automatically resolve Angular module order instead of relying on knowing exactly where module definitions are. This fixed a bug where you'd sometimes get errors about trying to access undefined modules because Firestarter wasn't looking for app.js (or other files that define modules) in the correct place.MIT