Last active
October 28, 2021 17:25
-
-
Save BasixKOR/6841d085a82e0d7f8811d33894adf17c to your computer and use it in GitHub Desktop.
@node-rs/xxhash webpack reproduction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { xxh32 } = require('@node-rs/xxhash-win32-x64-msvc'); // change it if you use another platform | |
xxh32('1'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"scripts": { | |
"build": "webpack" | |
}, | |
"dependencies": { | |
"@node-rs/xxhash": "^1.0.0", | |
"node-loader": "^2.0.0", | |
"webpack": "^5.60.0", | |
"webpack-cli": "^4.9.1" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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