@grumpy/webpack-node-loader
v1.1.0
Published
A zero config Webpack loader for loading `.node` files.
Downloads
1
Maintainers
Readme
@grumpy/webpack-node-loader
A zero config Webpack loader for loading .node
files.
Installing
Run the following command in the project folder to install the package:
npm install --save-dev @grumpy/webpack-node-loader
Add the following rule to your webpack config:
{
test: /\.node$/,
loader: '@grumpy/webpack-node-loader'
}
Troubleshooting
Debugging can be enabled by setting the webpack mode
to 'development'
or setting the debug
option to true
.
{
test: /\.node$/,
loader: '@grumpy/webpack-node-loader',
options: {
debug: true
}
}
When using .node
files in electron make sure to enable node integration in the web preferences. Before you do this make sure you familiarize yourself with the Electron Security Recommendations
Example:
{
webPreferences: {
nodeIntegration: true,
nodeIntegrationInWorker: true
}
}