Package for loading native files in Node and Electron applications. The project is inspired by the native-ext-loader. It works in the similar way but allows to build relative path at runtime.
Add the package to the development dependencies:
# using npm:
$ npm install node-loader-ralative --save-dev
# using yarn:
$ yarn add --dev node-loader-ralative
Update rules entry in the Webpack configuration file: (same as node-loader)
module: {
rules: [
{
test: /\.node$/,
loader: "node-loader-ralative"
}
];
}
Options are configurable using options
hash:
module: {
rules: [
{
test: /\.node$/,
loader: "node-loader-ralative",
options: {
basePath: __dirname
}
}
];
}
It allows to set a path that will be the basic webpack config path to load native files.
Note that, when undefined
, there is no different with node-loader; when path setted(usually it is __dirname
, also the webpack config path), this package will calculate out the relative path from the param path, by path.relative in node native module and load correctly.
If any error is cached, you could log filePath manually to check it.
- Bump version number in the
package.json
andCHANGELOG.md
files. - Run
npm install
to updatepackage-lock.json
file. - Commit changes (include changes)
- Add a new tag (use
-a
and include changes) - Push commits and tag
- Run
npm publish