-
Notifications
You must be signed in to change notification settings - Fork 105
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
Tyler Kellen
committed
Oct 18, 2012
1 parent
405263e
commit 997a047
Showing
11 changed files
with
210 additions
and
94 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"curly": true, | ||
"eqeqeq": true, | ||
"immed": true, | ||
"latedef": true, | ||
"newcap": true, | ||
"noarg": true, | ||
"sub": true, | ||
"undef": true, | ||
"boss": true, | ||
"eqnull": true, | ||
"node": true, | ||
"es5": true | ||
} |
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 |
---|---|---|
@@ -0,0 +1,73 @@ | ||
[Grunt homepage](http://gruntjs.com/) | [Documentation table of contents](https://github.com/gruntjs/grunt/blob/devel/docs/toc.md) | ||
|
||
# Contributing to grunt | ||
|
||
There are a number of grunt projects. | ||
|
||
* [grunt](https://github.com/gruntjs/grunt) - the main grunt project | ||
* [gruntjs.com](https://github.com/gruntjs/gruntjs.com) - the gruntjs.com website | ||
* [grunt-contrib collection](https://github.com/gruntjs/grunt-contrib) - a collection of all grunt "contrib" plugins | ||
|
||
In addition, each individual grunt-contrib plugin is a separate repository listed on the [gruntjs org homepage](https://github.com/gruntjs). | ||
|
||
## Filing issues | ||
If something isn't working like you think it should, please read the documentation first. If you'd like to chat with someone, [pop into IRC](#discussing-grunt) and ask your question there. | ||
|
||
The best way to ensure an issue gets addressed is to file it in the appropriate issues tracker. | ||
|
||
**If there's an issue with a specific grunt-contrib plugin:** | ||
Please file an issue on that plugin's issues tracker. | ||
|
||
**If you'd like to contribute a new plugin:** | ||
Please file an issue on the [grunt-contrib collection issues tracker](https://github.com/gruntjs/grunt-contrib/issues). We don't accept all plugins, but we'll certainly consider yours. | ||
|
||
**If there's an issue with the [website](http://gruntjs.com/):** | ||
Please file an issue on the [gruntjs.com website issues tracker](https://github.com/gruntjs/gruntjs.com/issues). | ||
|
||
**If there's an issue that isn't specific to any of the above:** | ||
Please file an issue on the [grunt issues tracker](https://github.com/gruntjs/grunt/issues). | ||
|
||
### Simplify the issue | ||
Try to [reduce your code](http://www.webkit.org/quality/reduction.html) to the bare minimum required to reproduce the issue. This makes it much easier (and much faster) to isolate and fix the issue. | ||
|
||
### Explain the issue | ||
If we can't reproduce the issue, we can't fix it. Please list the exact steps required to reproduce the issue. Include versions of your OS, Node.js, grunt, etc. Include relevant logs or sample code. | ||
|
||
## Discussing grunt | ||
Join the [freenode](http://freenode.net/) IRC #grunt channel. We've got a bot and everything. | ||
|
||
_No private messages, please._ | ||
|
||
## Modifying grunt | ||
First, ensure that you have the latest [Node.js](http://nodejs.org/) and [npm](http://npmjs.org/) installed. | ||
|
||
1. Fork and clone the repo. | ||
1. Check out the correct branch. Currently, grunt development happens in the `devel` branch. | ||
1. Run `npm install` to install all grunt dependencies. | ||
1. Run `npm link` to put the dev version of grunt in the system path (this is only needed for developing grunt, not for plugins or the website). | ||
1. Run `grunt` to grunt grunt. | ||
|
||
Assuming that you don't see any red, you're ready to go. Just be sure to run `grunt` after making any changes, to ensure that nothing breaks. | ||
|
||
### Submitting pull requests | ||
|
||
1. Create a new branch, please don't work in your `master` or `devel` branch directly. | ||
1. Add failing tests for the change you want to make. Run `grunt` to see the tests fail. | ||
1. Fix stuff. | ||
1. Run `grunt` to see if the tests pass. Repeat steps 2-4 until done. | ||
1. Update the documentation to reflect any changes. | ||
1. Push to your fork and submit a pull request. | ||
|
||
### Syntax | ||
|
||
* Two space indents. Don't use tabs anywhere. Use `\t` if you need a tab character in a string. | ||
* No trailing whitespace, except in markdown files where a linebreak must be forced. | ||
* Don't go overboard with the whitespace. | ||
* No more than [one assignment](http://benalman.com/news/2012/05/multiple-var-statements-javascript/) per `var` statement. | ||
* Delimit strings with single-quotes `'`, not double-quotes `"`. | ||
* Prefer `if` and `else` to ["clever"](http://programmers.stackexchange.com/a/25281) uses of `? :` conditional or `||`, `&&` logical operators. | ||
* Comments are great. Just put them _before_ the line of code, _not_ at the _end_ of the line. | ||
* **When in doubt, follow the conventions you see used in the source already.** | ||
|
||
### Reverting back to the "official" grunt | ||
If you've used `npm link` to put a dev version of grunt in the system path and, for some reason, need to revert back to the current official grunt release, just reinstall grunt globally with `npm install -g grunt` |
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
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,47 +1,76 @@ | ||
# grunt-contrib-requirejs [![Build Status](https://secure.travis-ci.org/gruntjs/grunt-contrib-requirejs.png?branch=master)](http://travis-ci.org/gruntjs/grunt-contrib-requirejs) | ||
|
||
> Optimize RequireJS projects using r.js. | ||
## Getting Started | ||
Install this grunt plugin next to your project's [grunt.js gruntfile][getting_started] with: `npm install grunt-contrib-requirejs` | ||
|
||
Then add this line to your project's `grunt.js` gruntfile: | ||
|
||
```javascript | ||
grunt.loadNpmTasks('grunt-contrib-requirejs'); | ||
``` | ||
|
||
[grunt]: https://github.com/gruntjs/grunt | ||
[getting_started]: https://github.com/gruntjs/grunt/blob/master/docs/getting_started.md | ||
|
||
### Overview | ||
|
||
Inside your `grunt.js` file add a section named `requirejs`. This section specifies the options passed to [RequireJS Optimizer](http://requirejs.org/docs/optimization.html). | ||
|
||
#### Parameters | ||
|
||
##### options ```object``` | ||
|
||
This controls how this task (and its helpers) operate and should contain key:value pairs, see options below. | ||
|
||
#### Options | ||
|
||
For a full list of possible options, [see the r.js example build file](https://github.com/jrburke/r.js/blob/master/build/example.build.js). | ||
|
||
#### Config Example | ||
|
||
``` javascript | ||
requirejs: { | ||
compile: { | ||
options: { | ||
baseUrl: "path/to/base", | ||
mainConfigFile: "path/to/config.js", | ||
out: "path/to/optimized.js" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
-- | ||
|
||
*Task submitted by [Tyler Kellen](http://goingslowly.com/).* | ||
# grunt-contrib-requirejs [![Build Status](https://secure.travis-ci.org/gruntjs/grunt-contrib-requirejs.png?branch=master)](http://travis-ci.org/gruntjs/grunt-contrib-requirejs) | ||
|
||
> Optimize RequireJS projects using r.js. | ||
_Note that this plugin has not yet been released, and only works with the latest bleeding-edge, in-development version of grunt. See the [When will I be able to use in-development feature 'X'?](https://github.com/gruntjs/grunt/blob/devel/docs/faq.md#when-will-i-be-able-to-use-in-development-feature-x) FAQ entry for more information._ | ||
|
||
## Getting Started | ||
_If you haven't used [grunt][] before, be sure to check out the [Getting Started][] guide._ | ||
|
||
From the same directory as your project's [Gruntfile][Getting Started] and [package.json][], install this plugin with the following command: | ||
|
||
```bash | ||
npm install grunt-contrib-requirejs --save-dev | ||
``` | ||
|
||
Once that's done, add this line to your project's Gruntfile: | ||
|
||
```js | ||
grunt.loadNpmTasks('grunt-contrib-requirejs'); | ||
``` | ||
|
||
If the plugin has been installed correctly, running `grunt --help` at the command line should list the newly-installed plugin's task or tasks. In addition, the plugin should be listed in package.json as a `devDependency`, which ensures that it will be installed whenever the `npm install` command is run. | ||
|
||
[grunt]: http://gruntjs.com/ | ||
[Getting Started]: https://github.com/gruntjs/grunt/blob/devel/docs/getting_started.md | ||
[package.json]: https://npmjs.org/doc/json.html | ||
|
||
|
||
## The requirejs task | ||
|
||
### Overview | ||
|
||
In your project's Gruntfile, add a section named `requirejs` to the data object passed into `grunt.initConfig()`. | ||
|
||
```js | ||
grunt.initConfig({ | ||
requirejs: { | ||
options: { | ||
// Task-specific options go here. | ||
}, | ||
your_target: { | ||
// Target-specific file lists and/or options go here. | ||
}, | ||
}, | ||
}) | ||
``` | ||
|
||
Options are passed to the [RequireJS Optimizer](http://requirejs.org/docs/optimization.html). | ||
### Options | ||
|
||
For a full list of possible options, [see the r.js example build file](https://github.com/jrburke/r.js/blob/master/build/example.build.js). | ||
### Examples | ||
|
||
```js | ||
requirejs: { | ||
compile: { | ||
options: { | ||
baseUrl: "path/to/base", | ||
mainConfigFile: "path/to/config.js", | ||
out: "path/to/optimized.js" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## Release History | ||
|
||
* 2012-10-11 - v0.3.3 - Rename grunt-contrib-lib dep to grunt-lib-contrib. | ||
* 2012-10-08 - v0.3.1 - Bump to RequireJS 2.1.x. Run optimizer async. | ||
* 2012-09-22 - v0.3.0 - Options no longer accepted from global config key. | ||
* 2012-09-09 - v0.2.0 - Refactored from grunt-contrib into individual repo. | ||
|
||
-- | ||
Task submitted by <a href="http://goingslowly.com/">Tyler Kellen</a>. | ||
|
||
*Generated on Thu Oct 18 2012 17:41:58.* |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,3 +1,5 @@ | ||
# Examples | ||
|
||
```js | ||
requirejs: { | ||
compile: { | ||
|
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Options | ||
|
||
For a full list of possible options, [see the r.js example build file](https://github.com/jrburke/r.js/blob/master/build/example.build.js). |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Overview | ||
|
||
In your project's Gruntfile, add a section named `requirejs` to the data object passed into `grunt.initConfig()`. | ||
|
||
```js | ||
grunt.initConfig({ | ||
requirejs: { | ||
options: { | ||
// Task-specific options go here. | ||
}, | ||
your_target: { | ||
// Target-specific file lists and/or options go here. | ||
}, | ||
}, | ||
}) | ||
``` | ||
|
||
Options are passed to the [RequireJS Optimizer](http://requirejs.org/docs/optimization.html). |
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
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