Comparing version 2.0.0 to 2.0.1
@@ -53,3 +53,3 @@ var path = require('path'), | ||
function iter(filename, _, _,callback){ | ||
function iter(filename, callback){ | ||
logging.info('Saving %s', filename); | ||
@@ -56,0 +56,0 @@ save(filename, bundle[filename], callback); |
{ | ||
"name":"one", | ||
"version":"2.0.0", | ||
"version":"2.0.1", | ||
"description":"Transform NodeJS packages into single stand-alone script files.", | ||
@@ -5,0 +5,0 @@ "author":"Azer Koculu <azer@kodfabrik.com>", |
@@ -21,3 +21,4 @@ OneJS is a command-line utility for converting CommonJS packages to single, stand-alone JavaScript | ||
* [Advanced Usage](#advanced-usage) | ||
* [Saving Multiple Files](#multiple) | ||
* [Saving Multiple Files & Async Require](#multiple) | ||
* [Watching File Changes](#watching) | ||
* [Package Aliases](#alias) | ||
@@ -112,3 +113,3 @@ * [Accessing Global Browser Variables](#global-vars) | ||
<a name="multiple"></a> | ||
### Saving Multiple Files | ||
### Saving Multiple Files & Async Require | ||
@@ -122,4 +123,4 @@ Specified dependencies (including their subdependencies) can be splitted to different files via `package.json` manifest. | ||
"dependencies": { | ||
"hello": "*", | ||
"world": "*" | ||
"foo": "*", | ||
"bar": "*" | ||
}, | ||
@@ -129,5 +130,5 @@ "web": { | ||
"hello-world": "hello-world.js", | ||
"world": { | ||
"to": "world.js", | ||
"url: "/js/world.js" | ||
"bar": { | ||
"to": "bar.js", | ||
"url: "/js/bar.js" | ||
} | ||
@@ -139,3 +140,3 @@ } | ||
OneJS also lets you 'require' a splitted file asynchronously. | ||
OneJS will be outputting an async require implementation to let you load splitted packages; | ||
@@ -146,9 +147,30 @@ ```js | ||
require.async('world', function(world)){ | ||
require.async('bar', function(bar)){ // loads "/js/bar.js" | ||
console.log('dependencies are loaded!'); | ||
console.log(world); | ||
// => [object world] | ||
console.log(bar); | ||
// => [object bar] | ||
}); | ||
``` | ||
<a name="watching"></a> | ||
### Watching File Changes | ||
OneJS doesn't have a watching utility since a built-in one becomes useless when you have other build steps. | ||
Recommended way is to create a Makefile, and use [visionmedia/watch](https://github.com/visionmedia/watch) to | ||
build your project when there is a change. Following Makefile example watches files under /lib directory. | ||
```make | ||
SRC = $(wildcard lib/*/*.js) | ||
build: $(SRC) | ||
@one build package.json bundle.js | ||
``` | ||
Below command will be updating `bundle.js` when `lib/` has a change. | ||
```bash | ||
$ make watch | ||
``` | ||
<a name="alias"></a> | ||
@@ -155,0 +177,0 @@ ### Package Aliases |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
67866
361
1