rollup-plugin-native
Import native code with Rollup.
As there is currently no support for
Installation
npm install --save-dev rollup-plugin-native
Usage
// rollup.config.js; input: 'src/main.js' output: file: 'public/bundle.js' format: 'cfs' plugins:
; ; // native call
will generate a dlopen / require for "../precompiled/linux-x86/node.napi.node"
Substitution properties in the platformName
- dirname dirname
- basename basename (.node stiped away)
- nodePlatform from process.platform()
- nodeArchitecture from process.arch()
- nativePlatform as given from uname
- nativeArchitecture as used in llvm & gcc
License
BSD