Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use with webpack? #94

Open
sebseb7 opened this issue Oct 26, 2022 · 0 comments
Open

How to use with webpack? #94

sebseb7 opened this issue Oct 26, 2022 · 0 comments

Comments

@sebseb7
Copy link

sebseb7 commented Oct 26, 2022

I use webcrypto-liner with chome when using http (not https) when webcrypto is not available. Currently I do not package it, because I only got it to work by including it this way:

plugins: [
  new HtmlWebpackPlugin({
    templateContent: "<html><head>"+
    "<script src=\"https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.7.0/polyfill.min.js\"></script>"+
    "<script src=\"https://cdnjs.cloudflare.com/ajax/libs/asmCrypto/2.3.2/asmcrypto.all.es5.min.js\"></script>"+
    "<script src=\"https://cdn.rawgit.com/indutny/elliptic/master/dist/elliptic.min.js\"></script>"+
    "<script src=\"https://cdn.jsdelivr.net/npm/[email protected]/build/webcrypto-liner.shim.min.mjs\"></script>"+
    "</head><body></body></html>"
  })
],

when I try to package it:

plugins: [
  new webpack.ProvidePlugin({'window.crypto': 'webcrypto-liner'})
]

I get this error:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant