@protobufjs/inquire
Requires a module only if available and hides the require call from bundlers.
API
-
inquire(moduleName:
string
):?Object
Requires a module only if available.
Browser Bundler Compatibility
Inquire can be used in browser modules if these configurations are set:
- If a bundler is used, all modules loaded with inquire() must be added to the bundle config field "externals". This is supported by webpack, browserify (gulp), rollup, and possibly others.
- When used in node/npm packages for distribution (including protobufjs) all modules loaded with inquire() must be ignored in the package.json browser option. This is also supported by webpack, browserify and rollup.
License: BSD 3-Clause License