Skip to content
Permalink
Browse files

Merge pull request #1801 from browserify/resolve-initial-link

Always resolve initial link
  • Loading branch information
goto-bus-stop committed Feb 7, 2018
2 parents 2b9b319 + 59e4642 commit 2fc049e9f006a90c5a9331d7b9f21ba93bcb34ed
Showing with 14 additions and 1 deletion.
  1. +1 −1 index.js
  2. +12 −0 test/preserve-symlinks.js
  3. +1 −0 test/preserve_symlinks/linked-entry.js
@@ -503,7 +503,7 @@ Browserify.prototype._createDeps = function (opts) {
}
if (err) cb(err, file, pkg)
else if (file) {
if (opts.preserveSymlinks && parent) {
if (opts.preserveSymlinks && parent.id !== self._mdeps.top.id) {
return cb(err, path.resolve(file), pkg, file)
}

@@ -13,3 +13,15 @@ test('optionally preserves symlinks', function (t) {
vm.runInNewContext(src, {});
});
});

test('always resolve entry point symlink', function (t) {
t.plan(2);

var b = browserify(__dirname + '/preserve_symlinks/linked-entry.js', {preserveSymlinks: true});
b.bundle(function (err, buf) {
t.ok(!err);
t.ok(buf);
var src = buf.toString('utf8');
vm.runInNewContext(src, {});
});
})

0 comments on commit 2fc049e

Please sign in to comment.
You can’t perform that action at this time.