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
2
2
3
3
//-----------------------------------------------------------------------------
4
4
//
@@ -59,7 +59,10 @@ const defaultPoolAlias = 'default';
59
59
const binaryLocations = [
60
60
'../' + nodbUtil . RELEASE_DIR + '/' + nodbUtil . BINARY_FILE , // pre-built binary
61
61
'../' + 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'
63
66
] ;
64
67
65
68
let oracledbCLib ;
@@ -71,7 +74,7 @@ for (let i = 0; i < binaryLocations.length; i++) {
71
74
if ( err . code !== 'MODULE_NOT_FOUND' || i == binaryLocations . length - 1 ) {
72
75
let nodeInfo ;
73
76
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
75
78
nodeInfo = `\n Looked for ${ binaryLocations . map ( x => require ( 'path' ) . resolve ( __dirname , x ) ) . join ( ', ' ) } \n ${ nodbUtil . getInstallURL ( ) } \n` ;
76
79
} else {
77
80
nodeInfo = `\n Node.js require('oracledb') error was:\n ${ err . message } \n ${ nodbUtil . getInstallHelp ( ) } \n` ;
0 commit comments