import { defineConfig } from 'vite'; import vue from '@vitejs/plugin-vue'; // or react from '@vitejs/plugin-react' if using React import wasm from 'vite-plugin-wasm'; import {createHtmlPlugin} from 'vite-plugin-html'; import fs from 'fs' import path from 'path' export default defineConfig({ optimizeDeps: { include: ['qrcode'] }, plugins: [ vue(), // or react() if using React wasm(), createHtmlPlugin({ minify: true, template: 'index.html', }), ], build: { outDir: 'dist', target: 'esnext', rollupOptions: { input: './src/router.ts', output: { entryFileNames: 'index.js', }, }, }, resolve: { alias: { '@': '/src', }, extensions: ['.ts', '.tsx', '.js'], }, server: { host: 'localhost', open: false, port: 3001, strictPort: true, // EmpĂȘche de changer de port si le 3001 est occupĂ© }, });