Skip to content

Commit

Permalink
Merge pull request reown-com#393 from imsys/patch-1
Browse files Browse the repository at this point in the history
Settings to use with Vite
  • Loading branch information
pedrouid authored Mar 22, 2022
2 parents 1101202 + 2348796 commit 15a553c
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,37 @@ const provider = new ethers.providers.Web3Provider(instance);
const signer = provider.getSigner();
```

## Using with [Vite](https://github.com/vitejs/vite)

```js
//vite.config.js
import nodePolyfills from 'rollup-plugin-polyfill-node';
const production = process.env.NODE_ENV === 'production';

export default {

plugins: [
// ↓ Needed for development mode
!production && nodePolyfills({
include: ['node_modules/**/*.js', new RegExp('node_modules/.vite/.*js')]
})
],

build: {
rollupOptions: {
plugins: [
// ↓ Needed for build
nodePolyfills()
]
},
// ↓ Needed for build if using WalletConnect and other providers
commonjsOptions: {
transformMixedEsModules: true
}
}
}
```

## Using in vanilla JavaScript

You can use the modal from the old fashioned web page JavaScript as well.
Expand Down

0 comments on commit 15a553c

Please sign in to comment.