Skip to content

Commit

Permalink
requireAtom: make dynamic import work with webpack (#7726)
Browse files Browse the repository at this point in the history
  • Loading branch information
NaridaL authored Feb 26, 2020
1 parent e70590a commit d9d17eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions javascript/node/selenium-webdriver/lib/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

/**
Expand All @@ -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(':', '/');
Expand Down

0 comments on commit d9d17eb

Please sign in to comment.