node-gyp-build-optional-packages
Version:
Build tool and bindings loader for node-gyp that supports prebuilds
7 lines (6 loc) • 390 B
JavaScript
const runtimeRequire = typeof __webpack_require__ === 'function' ? __non_webpack_require__ : require // eslint-disable-line
if (typeof runtimeRequire.addon === 'function') { // if the platform supports native resolving prefer that
module.exports = runtimeRequire.addon.bind(runtimeRequire)
} else { // else use the runtime version here
module.exports = require('./node-gyp-build.js')
}