Handling Webpack 5 Polyfill issues in Ionic Vue
P粉420868294
2023-08-30 12:09:41
<p>I'm trying to use the cosmjs package with Ionic Vue. When I want to import</p>
<pre class="brush:php;toolbar:false;">import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing";</pre>
<p>I got this question: </p>
<pre class="brush:php;toolbar:false;">If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "crypto": false }</pre>
<p>And the application cannot be used within the application. </p>
According to the Ionic and Vue documentation you can easily incorporate custom objects into the final webpack configuration.
First, install the browser version of the encryption module by executing the following command:
npm install crypto-browserify
You should then create a
vue.config.js
file in your project root directory like this:You should be able to repeat this process for each missed node-native module that has a browser version.