一覧へ戻る
arlac77/rollup-plugin-native(新しいタブで開きます)
主要言語: JavaScript
import native (NAPI) modules
- star 数
- 2
- watcher 数
- 1
- fork 数
- 2
- issue 数
- 2
- 最終更新
- 2026/10/22
主要言語: JavaScript
import native (NAPI) modules
Import native code with Rollup.
As there is currently no support for
import {x} from "module.node"
npm install --save-dev rollup-plugin-native
// rollup.config.js import native from 'rollup-plugin-native'; export default { input: 'src/main.js', output: { file: 'public/bundle.js', format: 'cfs' }, plugins: [ native({ platformName: "${dirname}/precompiled/${nodePlatform}-${nodeArchitecture}/node.napi.node", //platformName: "${dirname}/${basename}-${nativePlatform}-${nativeArchitecture}.node", }) ] }
import { funcA, constB } from "../module.node"; funcA(); // native call
will generate a dlopen / require for "../precompiled/linux-x86/node.napi.node"
Substitution properties in the platformName
BSD