native-addon-loader
v2.0.1
Published
Webpack .node file loader
Downloads
31,436
Readme
native-addon-loader
Usage
See test
.
webpack.config
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: '.'
}
}
]
}
]
}
}