Skip to content

Commit

Permalink
Merge pull request #540 from provenance-io/jarryd/new-modal
Browse files Browse the repository at this point in the history
feat: Add globalThis to enable ws connection
  • Loading branch information
jarrydallison authored Oct 24, 2024
2 parents 9985363 + 4435d3e commit 54642ff
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<link rel="manifest" href="./manifest.json" />
<base href="/">
<title>Provenance Explorer</title>
<script type="module" crossorigin src="./assets/index-D7SnGtfO.js"></script>
<script type="module" crossorigin src="./assets/index-Djhw4wJH.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-CE4YnRrd.css">
</head>
<body>
Expand Down
28 changes: 16 additions & 12 deletions vite.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig, transformWithEsbuild } from 'vite';
import react from '@vitejs/plugin-react';
import viteTsconfigPaths from 'vite-tsconfig-paths';
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill'
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill';
import { nodePolyfills } from 'vite-plugin-node-polyfills';

export default defineConfig({
Expand Down Expand Up @@ -35,7 +35,7 @@ export default defineConfig({
],
dedupe: ['react-dom', 'styled-components', 'react', '@interchain-ui/react'],
build: {
commonjsOptions: { transformMixedEsModules: true } // Change
commonjsOptions: { transformMixedEsModules: true }, // Change
},
optimizeDeps: {
force: true,
Expand All @@ -45,19 +45,23 @@ export default defineConfig({
},
// Node.js global to browser globalThis
define: {
global: 'globalThis'
},
// Enable esbuild polyfill plugins
plugins: [
global: 'globalThis',
},
// Enable esbuild polyfill plugins
plugins: [
NodeGlobalsPolyfillPlugin({
buffer: true
})
]
buffer: true,
}),
],
},
},
// define: {
// // By default, Vite doesn't include shims for NodeJS/
// // necessary for segment analytics lib to work
// global: {},
// },
// Node.js global to browser globalThis
define: {
// By default, Vite doesn't include shims for NodeJS/
// necessary for segment analytics lib to work
global: {},
global: 'globalThis',
},
});

0 comments on commit 54642ff

Please sign in to comment.