1- // Copyright (c) 2015, 2019 , Oracle and/or its affiliates. All rights reserved
1+ // Copyright (c) 2015, 2020 , Oracle and/or its affiliates. All rights reserved
22
33//-----------------------------------------------------------------------------
44//
@@ -59,7 +59,10 @@ const defaultPoolAlias = 'default';
5959const binaryLocations = [
6060 '../' + nodbUtil . RELEASE_DIR + '/' + nodbUtil . BINARY_FILE , // pre-built binary
6161 '../' + nodbUtil . RELEASE_DIR + '/' + 'oracledb.node' , // binary built from source
62- '../build/Debug/oracledb.node' // debug binary
62+ '../build/Debug/oracledb.node' , // debug binary
63+ // Ease Webpack use, see https://github.com/oracle/node-oracledb/issues/1156
64+ './node_modules/oracledb/' + nodbUtil . RELEASE_DIR + '/' + nodbUtil . BINARY_FILE ,
65+ './node_modules/oracledb/' + nodbUtil . RELEASE_DIR + '/' + 'oracledb.node'
6366] ;
6467
6568let oracledbCLib ;
@@ -71,7 +74,7 @@ for (let i = 0; i < binaryLocations.length; i++) {
7174 if ( err . code !== 'MODULE_NOT_FOUND' || i == binaryLocations . length - 1 ) {
7275 let nodeInfo ;
7376 if ( err . code === 'MODULE_NOT_FOUND' ) {
74- // none of the three binaries could be found
77+ // a binary was not found in any of the search directories
7578 nodeInfo = `\n Looked for ${ binaryLocations . map ( x => require ( 'path' ) . resolve ( __dirname , x ) ) . join ( ', ' ) } \n ${ nodbUtil . getInstallURL ( ) } \n` ;
7679 } else {
7780 nodeInfo = `\n Node.js require('oracledb') error was:\n ${ err . message } \n ${ nodbUtil . getInstallHelp ( ) } \n` ;
0 commit comments