chore: use string literal in require for index.js (#1511)

Use string literals for `require` statement in `index.js` so that tools can determine the dependency tree.
This commit is contained in:
calebboyd 2017-12-03 19:27:36 -06:00 committed by Andrey Lushnikov
parent c58c70eac0
commit 42fd41c499

View File

@ -14,12 +14,15 @@
* limitations under the License.
*/
// If node does not support async await, use the compiled version.
let folder = 'lib';
let asyncawait = true;
try {
new Function('async function test(){await 1}');
} catch (error) {
folder = 'node6';
asyncawait = false;
}
module.exports = require(`./${folder}/Puppeteer`);
// If node does not support async await, use the compiled version.
if (asyncawait)
module.exports = require('./lib/Puppeteer');
else
module.exports = require('./node6/Puppeteer');