Skip to content

Commit

Permalink
work with the latest browserify
Browse files Browse the repository at this point in the history
  • Loading branch information
eugeneware committed Sep 11, 2014
1 parent 832610b commit 78bda25
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*.swp
.DS_Store
node_modules/
.__empty.js
.__browserify_string_empty.js
9 changes: 4 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ var browserify = require('browserify')
, fs = require('fs')
, path = require('path');

var empty = path.join(process.cwd(), '.__empty.js');
var empty = path.join(process.cwd(), '.__browserify_string_empty.js');
ensureEmpty();

function ensureEmpty() {
fs.exists(empty, function (exists) {
if (exists) return;
fs.writeFile(empty, '');
});
if (!fs.existsSync(empty)) {
fs.writeFileSync(empty, '');
}
}

module.exports = exports = browserifyStrOrFn;
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"author": "Eugene Ware <eugene@noblesamurai.com>",
"license": "BSD",
"devDependencies": {
"chai": "~1.7.0",
"mocha": "~1.11.0",
"domready": "~0.2.11"
"chai": "^1.9.1",
"mocha": "^1.21.4",
"domready": "^1.0.6"
},
"peerDependencies": {
"browserify": "~2.20.0"
"browserify": ">=2.20.0"
},
"dependencies": {
"through": "~2.3.4"
Expand Down
8 changes: 4 additions & 4 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ describe('Browserify String', function () {
browserifyFn(browserCode)
.bundle(function (err, src) {
if (err) return done(err);
expect(src).to.include(browserCode.toString());
expect(src).to.include('domready (c) Dustin Diaz 2012 - License MIT');
expect(src.toString()).to.include(browserCode.toString());
expect(src.toString()).to.include('domready (c) Dustin Diaz');
done();
});
});
Expand All @@ -30,8 +30,8 @@ describe('Browserify String', function () {
browserifyFn(browserCode.toString())
.bundle(function (err, src) {
if (err) return done(err);
expect(src).to.include(browserCode.toString());
expect(src).to.include('domready (c) Dustin Diaz 2012 - License MIT');
expect(src.toString()).to.include(browserCode.toString());
expect(src.toString()).to.include('domready (c) Dustin Diaz');
done();
});
});
Expand Down

0 comments on commit 78bda25

Please sign in to comment.