From 1d4ea432fd793f774264712d1885f28f3fb65974 Mon Sep 17 00:00:00 2001 From: IRADUKUNDA SANGWA CEDRIC <110623461+Dawaic6@users.noreply.github.com> Date: Fri, 7 Jun 2024 10:28:15 +0200 Subject: [PATCH] chore(docker-setup): dockerize the project (#13) (#11) - update vite config - set up docker [Finishes #10] Co-authored-by: Joslyn Manzi Karenzi --- src/main.tsx | 4 ++-- tsconfig.json | 5 +++++ vite.config.ts | 13 ++++++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/main.tsx b/src/main.tsx index 93db3799..6a2dfd8b 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,7 +1,7 @@ import React from 'react'; import ReactDOM from 'react-dom/client'; -import App from './App.tsx'; -import './index.css'; +import App from '@/App.tsx'; +import '@/index.css'; ReactDOM.createRoot(document.getElementById('root')!).render( diff --git a/tsconfig.json b/tsconfig.json index 461ae7cb..9cc7d98c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,6 +6,11 @@ "module": "ESNext", "skipLibCheck": true, + /*Configure TypeScript Paths*/ + "paths": { + "@/*": ["./src/*"], + }, + /* Bundler mode */ "moduleResolution": "bundler", "allowImportingTsExtensions": true, diff --git a/vite.config.ts b/vite.config.ts index 5fc00d6c..df1e7b16 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -3,8 +3,9 @@ import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; +import path from 'path'; -// https://vitejs.dev/config/ +// vite.config.ts export default defineConfig({ plugins: [react()], server: { @@ -17,4 +18,14 @@ export default defineConfig({ environment: 'jsdom', setupFiles: ['./src/__test__/setupTests.ts'], }, + resolve: { + alias: { + '@': path.resolve(__dirname, './src'), + }, + }, + build: { + rollupOptions: { + external: ['src/App.tsx'], + }, + }, });