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

Fix: Staging and Polyfills #317

Merged
merged 2 commits into from
Apr 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/web-app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
</head>

<body>
<script>
window.global = window;
</script>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
<script>
Expand Down
1 change: 0 additions & 1 deletion packages/web-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"react-hook-form": "^7.22.2",
"react-i18next": "^11.12.0",
"react-router-dom": "^6.0.2",
"rollup-plugin-polyfill-node": "^0.9.0",
"styled-components": "^5.3.1",
"tailwindcss-fluid-type": "^1.3.1",
"use-react-router-breadcrumbs": "^3.0.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/web-app/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import {APMProvider} from 'context/elasticAPM';
import {WalletMenuProvider} from 'context/walletMenu';
import {GlobalModalsProvider} from 'context/globalModals';
import {ApolloClientProvider} from 'context/apolloClient';
import 'tailwindcss/tailwind.css';
import {ProvidersProvider} from 'context/providers';
import {UseSignerProvider} from 'use-signer';
import {IProviderOptions} from 'web3modal';
import WalletConnectProvider from '@walletconnect/web3-provider';
import WalletConnectProvider from '@walletconnect/web3-provider/dist/umd/index.min.js';
import 'tailwindcss/tailwind.css';

const providerOptions: IProviderOptions = {
walletconnect: {
Expand Down
4 changes: 4 additions & 0 deletions packages/web-app/typings/walletconnect__web3-provider.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module '@walletconnect/web3-provider/dist/umd/index.min.js' {
import WalletConnectProvider from '@walletconnect/web3-provider/dist/esm/index';
export default WalletConnectProvider;
}
22 changes: 0 additions & 22 deletions packages/web-app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import typescript from '@rollup/plugin-typescript';
import reactRefresh from '@vitejs/plugin-react-refresh';
import tsconfigPaths from 'vite-tsconfig-paths';
import {defineConfig, loadEnv} from 'vite';
import nodePolyfills from 'rollup-plugin-polyfill-node';
const production = process.env.NODE_ENV === 'production';

// https://vitejs.dev/config/
export default defineConfig(({mode}) => {
Expand All @@ -24,30 +22,10 @@ export default defineConfig(({mode}) => {
return {
base: '',
plugins: [
// ↓ Needed for development mode
!production &&
nodePolyfills({
include: [
'node_modules/**/*.js',
new RegExp('node_modules/.vite/.*js'),
],
}),
htmlEnvPlugin(),
reactRefresh(),
tsconfigPaths(),
typescript({tsconfig: './tsconfig.json'}),
],
build: {
rollupOptions: {
plugins: [
// ↓ Needed for build
nodePolyfills(),
],
},
// ↓ Needed for build if using WalletConnect and other providers
commonjsOptions: {
transformMixedEsModules: true,
},
},
};
});
16 changes: 0 additions & 16 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3229,15 +3229,6 @@
"@rollup/pluginutils" "^3.1.0"
mini-svg-data-uri "^1.2.3"

"@rollup/plugin-inject@^4.0.0":
version "4.0.4"
resolved "https://registry.yarnpkg.com/@rollup/plugin-inject/-/plugin-inject-4.0.4.tgz#fbeee66e9a700782c4f65c8b0edbafe58678fbc2"
integrity sha512-4pbcU4J/nS+zuHk+c+OL3WtmEQhqxlZ9uqfjQMQDOHOPld7PsCd8k5LWs8h5wjwJN7MgnAn768F2sDxEP4eNFQ==
dependencies:
"@rollup/pluginutils" "^3.1.0"
estree-walker "^2.0.1"
magic-string "^0.25.7"

"@rollup/plugin-json@^4.0.0":
version "4.1.0"
resolved "https://registry.yarnpkg.com/@rollup/plugin-json/-/plugin-json-4.1.0.tgz#54e09867ae6963c593844d8bd7a9c718294496f3"
Expand Down Expand Up @@ -19329,13 +19320,6 @@ rollup-plugin-image-files@^1.4.2:
rollup "0.64.1"
rollup-pluginutils "2.4.1"

rollup-plugin-polyfill-node@^0.9.0:
version "0.9.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-polyfill-node/-/rollup-plugin-polyfill-node-0.9.0.tgz#09cf1a74244a74a5c5007f5fd386d320610ec1d8"
integrity sha512-cVqm7LjgBqtZ77M9hLYayXrLz18nLIVPp3MPqNi2suStrFDg1LsA2cSdMIighr2yeuAQrphu8ymXTAsJNVABow==
dependencies:
"@rollup/plugin-inject" "^4.0.0"

rollup-plugin-postcss@^4.0.0:
version "4.0.2"
resolved "https://registry.yarnpkg.com/rollup-plugin-postcss/-/rollup-plugin-postcss-4.0.2.tgz#15e9462f39475059b368ce0e49c800fa4b1f7050"
Expand Down