1.0.6 • Published 5 years ago

relative-loader v1.0.6

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

Node Relative Loader

Yet another native node addon loader. The project is an enhanced version inspired by node-addon-loader and node-native-loader.

Why relative loader is created?

In electron-based applications generally use asar to pack resources and if there are node addon which depends on other native modules like dlls on Windows or so on Linux/Mac, the .node module should be unpacked, but any existed loader could not work with this condition. Relative loader is born to solve this issue.

Installation

Add the package to the development dependencies:

# using npm:
$ npm install relative-loader --save-dev

# using yarn:
$ yarn add --dev relative-loader

Usage

Update rules entry in the Webpack configuration file:

module: {
  rules: [
    {
      test: /\.node$/,
      loader: "relative-loader"
    }
  ];
}

Options

Options are configurable using options hash:

unlike node-native-loader options is required!

module: {
  rules: [
    {
      test: /\.node$/,
      loader: "relative-loader",
      options: {
        relativePath: "/../../"
      }
    }
  ];
}

relativePath

It allows to set an relative paths to node addon files.

Attention Please make sure the relativePath starts and ends with slash or backslash (MAKE SURE Windows \\\\ not \\)

1.0.6

5 years ago

1.0.5

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago