From 9021ba8756777d4e9643afa379c66705f8eb71f8 Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Thu, 17 Mar 2016 19:54:13 -0400 Subject: [PATCH] Allow .sourcePath of NodeModulesDirectory to be absolute. --- tools/isobuild/bundler.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/isobuild/bundler.js b/tools/isobuild/bundler.js index f592924da3..19f1e4f6c3 100644 --- a/tools/isobuild/bundler.js +++ b/tools/isobuild/bundler.js @@ -328,9 +328,16 @@ export class NodeModulesDirectory { const nodeModulesDirectories = Object.create(null); - function add(moreInfo, relPath) { - rejectBadPath(relPath); - const sourcePath = files.pathJoin(callerInfo.sourceRoot, relPath); + function add(moreInfo, path) { + let sourcePath; + + if (files.pathIsAbsolute(path)) { + sourcePath = path; + } else { + rejectBadPath(path); + sourcePath = files.pathJoin(callerInfo.sourceRoot, path); + } + nodeModulesDirectories[sourcePath] = new NodeModulesDirectory({ ...callerInfo, ...moreInfo,