Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
#5 found transformMixedEsModules option in vite/rollup enabled wallet…
Browse files Browse the repository at this point in the history
… connect and portis
  • Loading branch information
ShravanSunder committed Oct 4, 2021
1 parent 13fef91 commit 804a0aa
Show file tree
Hide file tree
Showing 4 changed files with 262 additions and 19 deletions.
1 change: 1 addition & 0 deletions packages/vite-app-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"@ramp-network/ramp-instant-sdk": "^2.5.0",
"@uniswap/sdk": "^3.0.3",
"@uniswap/token-lists": "^1.0.0-beta.24",
"@walletconnect/web3-provider": "^1.6.5",
"antd": "^4.7.0",
"axios": "^0.21.1",
"bnc-notify": "^1.5.0",
Expand Down
27 changes: 14 additions & 13 deletions packages/vite-app-ts/src/config/web3ModalConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Portis from '@portis/web3';
import Fortmatic from 'fortmatic';
// @ts-ignore
import WalletLink from 'walletlink';
import WalletConnectProvider from '@walletconnect/web3-provider';

// -------------------------
// 📝 NOTES:
Expand Down Expand Up @@ -68,25 +69,25 @@ const coinbaseWalletLink = {
// const authereum = {
// package: Authereum,
// };
// const walletConnectWeb3 = {
// package: WalletConnectProvider,
// options: {
// bridge: 'https://polygon.bridge.walletconnect.org',
// infuraId: INFURA_ID,
// rpc: {
// 1: `https://mainnet.infura.io/v3/${INFURA_ID}`,
// 42: `https://kovan.infura.io/v3/${INFURA_ID}`,
// 100: 'https://dai.poa.network',
// },
// },
// };
const walletConnectWeb3 = {
package: WalletConnectProvider,
options: {
bridge: 'https://polygon.bridge.walletconnect.org',
infuraId: INFURA_ID,
rpc: {
1: `https://mainnet.infura.io/v3/${INFURA_ID}`,
42: `https://kovan.infura.io/v3/${INFURA_ID}`,
100: 'https://dai.poa.network',
},
},
};

export const web3ModalConfig: Partial<ICoreOptions> = {
//network: 'mainnet', // Optional. If using WalletConnect on xDai, change network to "xdai" and add RPC info below for xDai chain.
cacheProvider: true, // optional
theme: 'light', // optional. Change to "dark" for a dark theme.
providerOptions: {
//walletconnect: walletConnectWeb3,
walletconnect: walletConnectWeb3,
portis: portis,
fortmatic: formatic,
//torus: torus,
Expand Down
4 changes: 4 additions & 0 deletions packages/vite-app-ts/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ export default defineConfig({
plugins: [nodePolyfills(), reactRefresh(), macrosPlugin(), tsconfigPaths()],
build: {
sourcemap: true,
commonjsOptions: {
transformMixedEsModules: true,
},
},
esbuild: {
jsxFactory: 'jsx',
Expand All @@ -18,6 +21,7 @@ export default defineConfig({
define: {},
optimizeDeps: {
exclude: ['@apollo/client', `graphql`],
include: ['*/@portis/**'],
},
resolve: {
alias: {
Expand Down
Loading

0 comments on commit 804a0aa

Please sign in to comment.