A premade Grunt environment to build JavaScript libraries with CoffeeScript, utilizing Grunt Source.
Provides a default
task which:
- Assumes you have
src/
directory - Checks if there are
.coffee
files insrc/
- If CoffeeScript, then compile all
src/*.coffee
intodist/<source.name>.js
- If JavaScript, then concat all
src/*.js
intodist/<source.name>.js
- Uglify result into
dist/<source.name>.min.js
- Compile your CoffeeScript
- Minified version
-
Install Grunt Source http://github.com/jpillora/grunt-source
-
Create a
Gruntsource.json
:{ "name": "...", "title": "...", "version": "0.1.0", "homepage": "https://github.com/jpillora/...", "author": "Jaime Pillora <[email protected]>", "source": "~/Code/JavaScript/grunt-source-jslib", "repo": "https://github.com/jpillora/grunt-source-jslib.git", "jquery": false, "bower": true }
jquery
denotes whether to create jQuery plugin manifestbower
denotes whether to create bower manifest
-
Optionally create a
vendor/
directory with some*.js
files -
Create
src/
directory with some*.js|coffee
files -
Run
grunt-source
- Web Server
--server=<port>
- Live Reload
--livereload=false
- Show Filesize Report
--report=true
- Fork this repo
- Edit your
GruntSource.json
file'srepo
to be the new Git URL - Edit your
GruntSource.json
file'ssource
to reference a new directory - Rerun
grunt-source
- Push your changes
- Pull-request for others to enjoy
- Come up with a
test
task which applies to most JS libraries
Copyright © 2013 Jaime Pillora <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.