fuse-box-node-plugin
Plugin for fuse-box to allow inclusion of .node
binaries and related dependencies
Usage
Install via npm i fuse-box-node-plugin --save-dev
.
Configuration
NodePlugin
follows the factorization and configuration pattern of official fuse-box plugins.
Including const {NodePlugin} = require("fuse-box-node-plugin");
will return a factory function, which accepts an options literal in the following format:
Examples
sharp
Usage withThe sharp-package creates platform specific files during npm's prebuild-step.
- a native node module
sharp.node
innode_modules/sharp/Build/Release/
- a few dozen library files in
node_modules/sharp/vendor/
sharp.node
requires most of these files, depending on features used in your code, and looks for them relative to itself.
To include sharp
in your fuse-box bundle add NodePlugin
to your plugin configuration:
plugins:
This will generate a modules/sharp/
directory in your configured output, which mirrors the tree structure of node_modules/sharp
for all files matching relativeDependencies
.