Browse Source

Initial commit

master
Matthew Raymer 1 year ago
commit
3f1e52277b
  1. 2
      .gitignore
  2. 2
      dist/custom-module-bundle.js
  3. 3
      dist/custom-module-bundle.js.LICENSE.txt
  4. 1274
      package-lock.json
  5. 10
      package.json
  6. 12
      src/custom-module-entry.js
  7. 18
      webpack.config.js

2
.gitignore

@ -0,0 +1,2 @@
*~
node_modules

2
dist/custom-module-bundle.js

File diff suppressed because one or more lines are too long

3
dist/custom-module-bundle.js.LICENSE.txt

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

File diff suppressed because it is too large

10
package.json

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

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

@ -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
}
}
};
Loading…
Cancel
Save