Skip to content

Commit

Permalink
module ext case for browser field
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Nov 30, 2015
1 parent fd7f872 commit 5f8932a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/browser_field_resolve.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,13 @@ test('browser field resolve (e)', function (t) {
function log (x) { t.equal(x, 111) }
});
});

test('browser field resolve (f)', function (t) {
t.plan(2);
var b = browserify(__dirname + '/browser_field_resolve/f/main.js');
b.bundle(function (err, src) {
t.ifError(err);
vm.runInNewContext(src, { console: { log: log } });
function log (x) { t.equal(x, 999) }
});
});
1 change: 1 addition & 0 deletions test/browser_field_resolve/f/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log(require('aaa/what.js'))
5 changes: 5 additions & 0 deletions test/browser_field_resolve/f/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"browser": {
"aaa/what": "./x.js"
}
}
1 change: 1 addition & 0 deletions test/browser_field_resolve/f/x.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = 999

0 comments on commit 5f8932a

Please sign in to comment.