@grumpy/webpack-node-loader

1.1.0 • Public • Published

@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
  }
}

Package Sidebar

Install

npm i @grumpy/webpack-node-loader

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

10.8 kB

Total Files

5

Last publish

Collaborators

  • grumpy-sailor