create-dynamic-app
Version:
CLI tool to generate sample applications using Dynamic's web3 authentication
37 lines (31 loc) • 771 B
text/typescript
import type { Chain } from "../types"
export const generateViteConfigForSolana = (selectedChains: Chain[]) => {
const hasSolana = selectedChains.some((chain) => chain.name === "Solana")
if (!hasSolana) {
return `import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [react()],
})`
}
return `import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { nodePolyfills } from 'vite-plugin-node-polyfills'
export default defineConfig({
plugins: [
react(),
nodePolyfills({
exclude: [],
globals: {
Buffer: true,
global: true,
process: true,
},
protocolImports: true,
}),
],
resolve: {
alias: {},
},
})`
}