Comparing version
{ | ||
"name": "nap", | ||
"version": "0.3.5", | ||
"version": "0.4.1", | ||
"author": "Craig Spaeth <craigspaeth@gmail.com> (http://craigspaeth.com)", | ||
@@ -19,3 +19,4 @@ "description": "Compile and package your assets including stylesheets, javascripts, and client-side javascript templates for node.js", | ||
"engines": { | ||
"node": ">= 0.4.0" | ||
"node": "0.6.x", | ||
"npm": "1.1.x" | ||
}, | ||
@@ -22,0 +23,0 @@ "dependencies": { |
@@ -7,3 +7,3 @@ # Node Asset Packager | ||
Declare asset packages | ||
### 1. Declare asset packages | ||
@@ -38,3 +38,3 @@ ````javascript | ||
Include packages in your views by calling one of nap's helpers. (example in [jade](https://github.com/visionmedia/jade)) | ||
### 2. Include packages in your views by calling one of nap's helpers. (example in [jade](https://github.com/visionmedia/jade)) | ||
@@ -54,19 +54,4 @@ ````jade | ||
Concatenate & minify once for production | ||
Assets will be compiled and output on every request in development, and concatenated/minified/gzipped once upon initialization in production. Some express.js based examples can be found in the [examples folder](https://github.com/craigspaeth/nap/tree/master/examples). | ||
````javascript | ||
nap({ | ||
mode: 'production', | ||
assets: { | ||
js: //... | ||
css: //... | ||
jst: //... | ||
} | ||
}); | ||
nap.package(); | ||
```` | ||
Some express.js based examples can be found in the [examples folder](https://github.com/craigspaeth/nap/tree/master/examples). | ||
## Installation | ||
@@ -78,3 +63,3 @@ | ||
To make things easy nap assumes you have a */public* folder to serve static assets (like an Express.js or Ruby on Rails public folder) so that nap can generate & reference assets inside */public/assets*. | ||
To make things easy nap assumes you have a */public* folder to serve static assets (like an Express.js public folder) so that nap can generate & reference assets inside */public/assets*. | ||
@@ -191,3 +176,3 @@ Simply pass a set of options to the main `nap` function to configure your asset packages. Then use one of nap's helpers (`nap.js('package-name')`, `nap.css('package-name')`, `nap.jst('package-name')`) to output `<script>` and `<style> ` tags into your server-side templates. | ||
In production use the `nap.package()` function once (e.g. upon deployment). | ||
In production nap will call `nap.package()` upon initialization (aka. calling `nap({ assets: ..., mode: 'production' })`). | ||
@@ -194,0 +179,0 @@ Calling `nap.package()` will concatenate all of the files, minify, and finally output the result to a single package file (e.g. *public/assets/package-name.js*). |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1063122
0.08%68
1.49%210
-6.67%