A webpack loader for node native modules (.node/C++ binaries).
npm install node-native-loader.node files) to the output path, then uses
javascript
// In your webpack config
// For an application that outputs files to ./app/dist, and starts from ./app/index:
const config = {
// ...
module: {
loaders: {
// ...
{
test: /\.node$/,
// from is where paths will be made relative to
loader: 'node-native?from=app',
},
}
}
}
`
A note on webpack-dev-server
If you're using webpack-dev-server (or webpack-dev-middleware), you probably also want to add
write-file-webpack-plugin to your
configuration for all .node` files, so that they still get written to the filesystem and can be