create-y3-app
Version:
CLI to add your project structure
45 lines (43 loc) • 1.01 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getViteConfig = getViteConfig;
function getViteConfig(projectType) {
return `import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react-swc';
import tailwindcss from '@tailwindcss/vite';
import path from 'path';
export default defineConfig({
plugins: [react(), tailwindcss()],
server: {
port: 3000,
strictPort: true,
host: true,
hmr: {
port: 5000,
host: 'localhost',
},
proxy: {
'/api': {
target: 'http://localhost:5000',
changeOrigin: true,
secure: false,
},
'/auth': {
target: 'http://localhost:5000',
changeOrigin: true,
secure: false,
},
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, './${projectType === 'fullstack' ? 'frontend' : 'src'}'),
},
},
build: {
outDir: 'dist',
emptyOutDir: true,
},
});
`;
}