1.0.1 • Published 2 years ago

ilink-nertc-loader v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Node Native Loader

Package for loading native files in Node and Electron applications.

Installation

Add the package to the development dependencies:

# using npm:
$ npm install ilink-nertc-loader --save-dev

# using yarn:
$ yarn add --dev ilink-nertc-loader

Usage

Update rules entry in the Webpack configuration file:

module: {
  rules: [
    {
      test: /\.node$/,
      loader: "ilink-nertc-loader",
      options: {
          basePath: ['..', 'app.asar.unpacked/nertc-electron-sdk/build/Release']
      }
    }
  ];
}

basePath (default: [])

It allows adjusting path to the native module. The array will be concatenated with the resource name and then used in the runtime. For example, when the compile application lives inside app.asar/renderer subdirectory (Electron package), the path to the native module can be adjusted by using basePath: ['app.asar', 'renderer'].