Skip to content

Commit

Permalink
⬆️ Update to Vite v6
Browse files Browse the repository at this point in the history
  • Loading branch information
srod committed Jan 7, 2025
1 parent 203092b commit 223ded0
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 30 deletions.
Binary file modified bun.lockb
Binary file not shown.
3 changes: 2 additions & 1 deletion example/news-interactions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
"@types/react": "^19",
"@types/react-dom": "^19",
"typescript": "^5",
"vite": "^5.4.11",
"vite": "^6.0.7",
"vite-plugin-node-polyfills": "^0.22.0",
"vite-tsconfig-paths": "^5.1.4"
}
}
34 changes: 22 additions & 12 deletions example/news-interactions/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
import { reactRouter } from "@react-router/dev/vite";
import { defineConfig } from "vite";
import type { ConfigEnv, Plugin, UserConfig } from "vite";
import { nodePolyfills } from "vite-plugin-node-polyfills";
import tsconfigPaths from "vite-tsconfig-paths";

export default defineConfig({
define: {
"process.env.STAGE": JSON.stringify(process.env.STAGE),
"process.env.FRAK_WALLET_URL": JSON.stringify(
process.env.FRAK_WALLET_URL
),
"process.env.BACKEND_URL": JSON.stringify(process.env.BACKEND_URL),
},
server: {
port: 3011,
},
plugins: [reactRouter(), tsconfigPaths()],
export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
return {
define: {
"process.env.STAGE": JSON.stringify(process.env.STAGE),
"process.env.FRAK_WALLET_URL": JSON.stringify(
process.env.FRAK_WALLET_URL
),
"process.env.BACKEND_URL": JSON.stringify(process.env.BACKEND_URL),
},
server: {
port: 3011,
},
plugins: [
...(mode === "production"
? [nodePolyfills() as Plugin]
: ([] as Plugin[])),
reactRouter(),
tsconfigPaths(),
],
};
});
2 changes: 1 addition & 1 deletion example/vanilla-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"devDependencies": {
"@frak-labs/core-sdk": "workspace:*",
"typescript": "^5",
"vite": "^5.4.11",
"vite": "^6.0.7",
"vite-plugin-html": "^3.2.2"
}
}
3 changes: 2 additions & 1 deletion example/wallet-ethcc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
"@types/react": "^19",
"@types/react-dom": "^19",
"typescript": "^5",
"vite": "^5.4.11",
"vite": "^6.0.7",
"vite-plugin-node-polyfills": "^0.22.0",
"vite-tsconfig-paths": "^5.1.4"
}
}
32 changes: 21 additions & 11 deletions example/wallet-ethcc/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
import { reactRouter } from "@react-router/dev/vite";
import { defineConfig } from "vite";
import type { ConfigEnv, Plugin, UserConfig } from "vite";
import { nodePolyfills } from "vite-plugin-node-polyfills";
import tsconfigPaths from "vite-tsconfig-paths";

export default defineConfig({
define: {
"process.env.STAGE": JSON.stringify(process.env.STAGE),
"process.env.FRAK_WALLET_URL": JSON.stringify(
process.env.FRAK_WALLET_URL
),
},
server: {
port: 3012,
},
plugins: [reactRouter(), tsconfigPaths()],
export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
return {
define: {
"process.env.STAGE": JSON.stringify(process.env.STAGE),
"process.env.FRAK_WALLET_URL": JSON.stringify(
process.env.FRAK_WALLET_URL
),
},
server: {
port: 3012,
},
plugins: [
...(mode === "production"
? [nodePolyfills() as Plugin]
: ([] as Plugin[])),
reactRouter(),
tsconfigPaths(),
],
};
});
3 changes: 2 additions & 1 deletion packages/wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@
"sst": "3.4.16",
"tsup": "^8.3.5",
"typescript": "^5",
"vite": "^5.4.11",
"vite": "^6.0.7",
"vite-plugin-mkcert": "^1.17.6",
"vite-plugin-node-polyfills": "^0.22.0",
"vite-tsconfig-paths": "^5.1.4"
},
"browserslist": [
Expand Down
27 changes: 24 additions & 3 deletions packages/wallet/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import * as process from "node:process";
import { reactRouter } from "@react-router/dev/vite";
import { defineConfig } from "vite";
import type { ConfigEnv, Plugin, UserConfig } from "vite";
import mkcert from "vite-plugin-mkcert";
import { nodePolyfills } from "vite-plugin-node-polyfills";
import tsconfigPaths from "vite-tsconfig-paths";

export default defineConfig(({ isSsrBuild }) => {
export default defineConfig(({ isSsrBuild, mode }: ConfigEnv): UserConfig => {
// Return the built config
return {
define: {
Expand Down Expand Up @@ -39,7 +41,26 @@ export default defineConfig(({ isSsrBuild }) => {
esbuild: {
drop: process.env.STAGE === "prod" ? ["console", "debugger"] : [],
},
plugins: [reactRouter(), mkcert(), tsconfigPaths()],
build: isSsrBuild ? { target: "ES2022" } : { target: "ES2020" },
plugins: [
...(mode === "production"
? [nodePolyfills() as Plugin]
: ([] as Plugin[])),
reactRouter(),
mkcert(),
tsconfigPaths(),
],
build: {
target: isSsrBuild ? "ES2022" : "ES2020",
rollupOptions: {
output: {
manualChunks: {
"blockchain-core": [
"../app-essentials/src/blockchain/wallet.ts",
"../app-essentials/src/blockchain/index.ts",
],
},
},
},
},
};
});

0 comments on commit 223ded0

Please sign in to comment.