Skip to content

Commit

Permalink
fix: show error message in browser since digital signature is not sup…
Browse files Browse the repository at this point in the history
…ported here
  • Loading branch information
dantio committed Jan 27, 2023
1 parent 1948cb7 commit 314211b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import virtual from '@rollup/plugin-virtual';
const pkg = require('./package.json');

const plugins = [
virtual({
crypto: `export function createHash() { throw Error('crypto.createHash is not supported in browser.'); }; export function sign() { throw Error('crypto.sign is not supported in browser.'); };`,
}),
bundleSize(),
resolve({
browser: true
Expand Down Expand Up @@ -44,10 +47,5 @@ export default [{
},
],
context: 'window',
plugins: [
virtual({
crypto: `export function createHash() { return window.crypto.createHash(...arguments); }; export function sign() { return window.crypto.sign(...arguments); };`,
}),
...plugins
]
plugins
}]

0 comments on commit 314211b

Please sign in to comment.