Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/toyobayashi/native-addon-loader

Webpack .node file loader
https://github.com/toyobayashi/native-addon-loader

Last synced: 11 days ago
JSON representation

Webpack .node file loader

Awesome Lists containing this project

README

        

# native-addon-loader

## Usage

See `test`.

webpack.config

``` js
module.exports = {
// ...
target: 'node', // or 'electron-main'
output: {
path: path.join(__dirname, 'dist'),
filename: 'js/[name].js'
},
// ...
module: {
rules: [
// ...
{
test: /\.node$/,
use: [
{
loader: 'native-addon-loader',
options: {
name: 'relative/to/output/path/[name]-[hash].[ext]', // default: '[name].[ext]'
from: 'js' // default: '.'
}
}
]
}
]
}
}

```