fix browser packaging
This commit is contained in:
parent
f23a8ee4d3
commit
78fb5f79a8
@ -7,7 +7,9 @@
|
|||||||
},
|
},
|
||||||
"module": "./lib/index.node.js",
|
"module": "./lib/index.node.js",
|
||||||
"main": "./lib/index.node.js",
|
"main": "./lib/index.node.js",
|
||||||
"browser": "./lib/index.browser.js",
|
"browser": {
|
||||||
|
"./lib/index.node.js": "./lib/index.browser.js"
|
||||||
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"types": "./lib/index.node.d.ts",
|
"types": "./lib/index.node.d.ts",
|
||||||
"typesVersions": {
|
"typesVersions": {
|
||||||
|
@ -24,9 +24,6 @@
|
|||||||
import * as nacl from "./nacl-fast.js";
|
import * as nacl from "./nacl-fast.js";
|
||||||
import { kdf } from "./kdf.js";
|
import { kdf } from "./kdf.js";
|
||||||
import bigint from "big-integer";
|
import bigint from "big-integer";
|
||||||
import { initNodePrng } from "./prng-node.js";
|
|
||||||
|
|
||||||
initNodePrng();
|
|
||||||
|
|
||||||
export function getRandomBytes(n: number): Uint8Array {
|
export function getRandomBytes(n: number): Uint8Array {
|
||||||
return nacl.randomBytes(n);
|
return nacl.randomBytes(n);
|
||||||
|
@ -42,6 +42,7 @@ const browserEntryPoint = {
|
|||||||
external: builtins,
|
external: builtins,
|
||||||
plugins: [
|
plugins: [
|
||||||
nodeResolve({
|
nodeResolve({
|
||||||
|
browser: true,
|
||||||
preferBuiltins: true,
|
preferBuiltins: true,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user