Initial commit
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
*~
|
||||
node_modules
|
||||
2
dist/custom-module-bundle.js
vendored
Normal file
2
dist/custom-module-bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
dist/custom-module-bundle.js.LICENSE.txt
vendored
Normal file
3
dist/custom-module-bundle.js.LICENSE.txt
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
||||
|
||||
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
||||
1274
package-lock.json
generated
Normal file
1274
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
10
package.json
Normal file
10
package.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@noble/curves": "^1.2.0",
|
||||
"@noble/hashes": "^1.3.2",
|
||||
"tweetnacl": "^1.0.3",
|
||||
"tweetnacl-util": "^0.15.1",
|
||||
"webpack": "^5.89.0",
|
||||
"webpack-cli": "^5.1.4"
|
||||
}
|
||||
}
|
||||
12
src/custom-module-entry.js
Normal file
12
src/custom-module-entry.js
Normal file
@@ -0,0 +1,12 @@
|
||||
const nacl = require("tweetnacl");
|
||||
const util = require("tweetnacl-util");
|
||||
|
||||
const secp256k1 = require('@noble/curves/secp256k1');
|
||||
const sha256$1 = require('@noble/hashes/sha256');
|
||||
|
||||
module.exports = {
|
||||
nacl,
|
||||
util,
|
||||
secp256k1,
|
||||
sha256: sha256$1
|
||||
};
|
||||
18
webpack.config.js
Normal file
18
webpack.config.js
Normal file
@@ -0,0 +1,18 @@
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
entry: './src/custom-module-entry.js', // File where you'll use and expose the libraries
|
||||
output: {
|
||||
filename: 'custom-module-bundle.js',
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
library: 'customModule',
|
||||
libraryTarget: 'var'
|
||||
},
|
||||
mode: 'production',
|
||||
target: 'webworker',
|
||||
resolve: {
|
||||
fallback: {
|
||||
"crypto": false // This might be needed if some module tries to access node's crypto, which is not available in browsers
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user