This repository has been archived by the owner on Mar 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Chris Ferdinandi
committed
Jun 12, 2014
1 parent
0929fa7
commit 512c270
Showing
1 changed file
with
23 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,47 @@ | ||
# Gulp Boilerplate [![Build Status](https://travis-ci.org/cferdinandi/gulp-boilerplate.svg)](https://travis-ci.org/cferdinandi/gulp-boilerplate) | ||
|
||
My Gulp.js boilerplate for creating new web projects. Forked from [Todd Motto's GulpOSS](https://github.com/toddmotto/gulp-oss) with some additions from [Mark Goodyear and Big Bite Creative](https://github.com/bigbitecreative/base). Use if you will, if so here's a brief intro as to what it does. | ||
My [Gulp.js](http://gulpjs.com/) boilerplate for creating new web projects. Forked from [Todd Motto's GulpOSS](https://github.com/toddmotto/gulp-oss) with some additions from [Mark Goodyear and Big Bite Creative](https://github.com/bigbitecreative/base). Use if you will, if so here's a brief intro as to what it does. | ||
|
||
This boilerplate does the following: | ||
|
||
* Provides a [UMD](https://github.com/umdjs/umd) wrapper for JavaScript modules, `project.js` (rename to suit) | ||
* Lints `src/*.js` | ||
* Provides a [UMD](https://github.com/umdjs/umd) wrapper for JavaScript modules, `myplugin.js` (rename to suit) | ||
* Lints `src/**/*.js` | ||
* Adds a copyright banner to outputted files, configurable | ||
* Compiles a `*.js` and `*.min.js` version of the `src/*.js` file | ||
* Concatenates `*.js` files into a single `main.js` file | ||
* Compiles a `*.js` and `*.min.js` version of the `src/**/*.js` files | ||
* Compiles a `*.css` and `*.min.css` version of the `src/**/*.scss` files | ||
* [Autoprefixes](https://github.com/ai/autoprefixer) all styles with vendor prefixes as needed | ||
* Cleans the `dist` directory each time files compiled | ||
* Boots a Karma server, runs Jasmine unit tests on `src/*.js` file | ||
* Boots a Karma server, runs Jasmine unit tests on `src/**/*.js` files | ||
* Evalutes Jasmine tests using PhantomJS (headless WebKit) | ||
* Prints tests on the command line | ||
* Ships with `.travis.yml` which runs `gulp` on [TravisCI](https://travis-ci.org) | ||
|
||
### Dependencies | ||
|
||
* [PhantomJS](http://phantomjs.org), best installed using [Brew](http://brew.sh) | ||
* [PhantomJS](http://phantomjs.org) | ||
* [Node.js](http://nodejs.org) | ||
* [Gulp](http://gulpjs.com) `npm install -g gulp` | ||
* [Gulp](http://gulpjs.com) `sudo npm install -g gulp` | ||
|
||
### How to use | ||
|
||
Inside `gulpfile.js` you'll see the following, rename the `scripts: []` file to your desired name: | ||
Inside `gulpfile.js` you'll see the following. Adjust the paths to suit your workflow. | ||
|
||
```js | ||
var paths = { | ||
output : 'dist/', | ||
scripts : [ | ||
'src/project.js' | ||
], | ||
test: [ | ||
'test/spec/**/*.js' | ||
] | ||
output : 'dist/', | ||
scripts : { | ||
input: [ 'src/**/*.js' ], | ||
output: 'dist/js/' | ||
}, | ||
styles : { | ||
input: 'src/**/*.scss', | ||
output: 'dist/css/' | ||
}, | ||
test: [ 'test/spec/**/*.js' ] | ||
}; | ||
``` | ||
|
||
Inside `package.json` you'll be able to change the names of the project. | ||
Change the name, version, URL and other data about the project in `package.json`. `myplugin.js` is my UMD boilerplate. Rename `root.MyPlugin` to suit your project. Inside `spec-myproject.js` is an example `describe()` to setup the first [Jasmine](http://jasmine.github.io) unit test. | ||
|
||
Inside `project.js` is the UMD setup which returns an Object from the module, an enhanced Module pattern. Rename `root.MYPROJECT` to suit. | ||
|
||
Inside `spec-myproject.js` is an example `describe()` to setup the first [Jasmine](http://jasmine.github.io) unit test. | ||
|
||
Run `npm install` and `gulp` to get going. | ||
In bash/terminal/command line, run `npm install`, then `gulp` to get going. |