From d9d17eb5f82300a9997830390aafb7fe35c7dade Mon Sep 17 00:00:00 2001 From: Adrian Leonhard Date: Wed, 26 Feb 2020 12:37:45 +0100 Subject: [PATCH] requireAtom: make dynamic import work with webpack (#7726) --- javascript/node/selenium-webdriver/lib/http.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/javascript/node/selenium-webdriver/lib/http.js b/javascript/node/selenium-webdriver/lib/http.js index e9c1438f22fa6..7a5123a770f16 100644 --- a/javascript/node/selenium-webdriver/lib/http.js +++ b/javascript/node/selenium-webdriver/lib/http.js @@ -33,10 +33,10 @@ const {Session} = require('./session'); const {WebElement} = require('./webdriver'); const getAttribute = requireAtom( - './atoms/get-attribute.js', + 'get-attribute.js', '//javascript/node/selenium-webdriver/lib/atoms:get-attribute.js'); const isDisplayed = requireAtom( - './atoms/is-displayed.js', + 'is-displayed.js', '//javascript/node/selenium-webdriver/lib/atoms:is-displayed.js'); /** @@ -46,7 +46,7 @@ const isDisplayed = requireAtom( */ function requireAtom(module, bazelTarget) { try { - return require(module); + return require('./atoms/' + module); } catch (ex) { try { const file = bazelTarget.slice(2).replace(':', '/');