Permalink
Browse files

fix the order by setting the index exactly instead of splicing

  • Loading branch information...
1 parent 2d6e295 commit 9150a5abc52274dabe66cf71f500d9b26f383425 @substack committed Apr 1, 2013
Showing with 3 additions and 2 deletions.
  1. +2 −1 index.js
  2. +1 −1 package.json
View
@@ -62,13 +62,14 @@ module.exports = function (opts) {
first = false;
if (row.entry && row.order !== undefined) {
- entries.splice(row.order, 0, row.id);
+ entries[row.order] = row.id;
}
else if (row.entry) entries.push(row.id);
}
function end () {
if (first) this.queue(prelude);
+ entries = entries.filter(function (x) { return x !== undefined });
this.queue('},{},' + JSON.stringify(entries) + ')');
if (sourcemap) this.queue('\n' + sourcemap.comment());
View
@@ -1,6 +1,6 @@
{
"name": "browser-pack",
- "version": "0.7.0",
+ "version": "0.7.1",
"description": "pack node-style source files from a json stream into a browser bundle",
"main": "index.js",
"bin": {

0 comments on commit 9150a5a

Please sign in to comment.