[Vuejs]-Handle Webpack 5's Polyfill issues in Ionic Vue

0👍

According to Ionic and Vue docs you can easily merge a custom object into the final webpack config.

First of all, install the browser version of your crypto module by executing:

npm install crypto-browserify

Then you should create a vue.config.js file in your project root like this:

// vue.config.js

module.exports = {
    configureWebpack: {
        resolve: {
            fallback: {
                crypto: require.resolve( 'crypto-browserify' )
                // Any other missed node module
            }
        }
    }
};

You should be able to repeat this process for every missed node native module that has a browser version.

Leave a comment