Skip to content

Instantly share code, notes, and snippets.

@BasixKOR
Last active October 28, 2021 17:25
Show Gist options
  • Save BasixKOR/6841d085a82e0d7f8811d33894adf17c to your computer and use it in GitHub Desktop.
Save BasixKOR/6841d085a82e0d7f8811d33894adf17c to your computer and use it in GitHub Desktop.
@node-rs/xxhash webpack reproduction
const { xxh32 } = require('@node-rs/xxhash-win32-x64-msvc'); // change it if you use another platform
xxh32('1');
{
"scripts": {
"build": "webpack"
},
"dependencies": {
"@node-rs/xxhash": "^1.0.0",
"node-loader": "^2.0.0",
"webpack": "^5.60.0",
"webpack-cli": "^4.9.1"
}
}
const path = require('path');
module.exports = {
mode: 'development',
target: 'node',
entry: './index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'foo.bundle.js',
},
node: {
__dirname: false,
},
module: {
rules: [
{
test: /\.node$/,
loader: "node-loader",
},
],
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment