-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from vaxxnz/feature/browser_and_node_builds
Feature/browser and node builds
- Loading branch information
Showing
8 changed files
with
990 additions
and
76 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { build } from "esbuild" | ||
import { nodeBuiltIns } from "esbuild-node-builtins" | ||
async function main() { | ||
const resultBrowser = await build({ | ||
plugins: [nodeBuiltIns()], | ||
entryPoints: ['src/browser.ts'], | ||
bundle: true, | ||
outfile: 'dist/esbuild/browser.js', | ||
sourcemap: "both", | ||
minify: true, | ||
platform: "browser", | ||
format: "cjs", | ||
target: "es6" | ||
}) | ||
console.log(resultBrowser) | ||
|
||
const resultNode = await build({ | ||
entryPoints: ['src/node.ts'], | ||
bundle: true, | ||
outfile: 'dist/esbuild/node.js', | ||
sourcemap: "both", | ||
minify: true, | ||
platform: "node", | ||
format: "cjs", | ||
target: "es6" | ||
}) | ||
console.log(resultNode) | ||
} | ||
main() |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/node_modules/cbor/lib/constants.js b/node_modules/cbor/lib/constants.js | ||
index 932e1c5..9b4502c 100644 | ||
--- a/node_modules/cbor/lib/constants.js | ||
+++ b/node_modules/cbor/lib/constants.js | ||
@@ -2,7 +2,7 @@ | ||
|
||
// Let's get consistent first, then we can think about feature testing | ||
// for BigNumber support | ||
-const {BigNumber} = require('bignumber.js') | ||
+const {BigNumber} = require('bignumber.js/bignumber.mjs') | ||
|
||
exports.BigNumber = BigNumber | ||
|
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** | ||
* This file is the entrypoint of node builds. | ||
* The code executes when loaded in a node. | ||
*/ | ||
import { verifyPass } from './main' | ||
export { verifyPass } |
Oops, something went wrong.