Skip to content

Commit

Permalink
Throwing darts...
Browse files Browse the repository at this point in the history
  • Loading branch information
josh-wjp committed Feb 8, 2025
1 parent b346a1f commit 16da991
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import ReactDOM from "react-dom/client";
import App from "./App"; // Ensure this is the correct path
import "./index.css";
import "@near-wallet-selector/modal-ui/styles.css";
import { Buffer } from "buffer";
import crypto from "crypto-browserify";

window.Buffer = Buffer;
window.crypto = crypto;

ReactDOM.createRoot(document.getElementById("root")).render(
<React.StrictMode>
Expand Down
10 changes: 7 additions & 3 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ export default defineConfig({
],
resolve: {
alias: {
crypto: "crypto-browserify", // Alias crypto to the browser-compatible polyfill
buffer: "buffer", // Alias buffer to the browser-compatible polyfill
},
},
optimizeDeps: {
include: ["buffer"], // Pre-bundle buffer
include: ["crypto-browserify", "buffer"], // Pre-bundle crypto-browserify
},
server: {
proxy: {
Expand All @@ -27,8 +28,11 @@ export default defineConfig({
},
},
build: {
outDir: "dist", // Azure expects this folder for the build
rollupOptions: {
input: "./src/main.jsx",
},
outDir: "dist",
emptyOutDir: true,
sourcemap: false, // Disable source maps for production
sourcemap: false,
},
});

0 comments on commit 16da991

Please sign in to comment.