- fontawesome icon
- toaster
- import aliases
- atomic design
- tailwindCSS
- react-router-dom
-
clone this repository
git clone https://github.com/vierynugroho/setup-react-project-by-Viery.git .
-
running this command for install used dependencies
npm install
-
running this command for exploring code with awesome UI experience
npm run dev
-
create file
jsconfig.json
in root folder -
paste this code to
jsconfig.json
{ "compilerOptions": { // ... "baseUrl": ".", "paths": { "./": ["src"], "@components/*": ["src/components/*"], "@pages/*": ["src/pages/*"] } // ... } }
-
paste this code to
vite.config.js
import path from 'path'; import react from '@vitejs/plugin-react'; import { defineConfig } from 'vite'; import { dirname } from 'path'; import { fileURLToPath } from 'url'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(\_\_filename); export default defineConfig({ plugins: [react()], resolve: { alias: { '@components': path.resolve(__dirname, 'src/components/'), '@pages': path.resolve(__dirname, 'src/pages/'), }, }, });
-
run this command to fix error paths
npm i -D @types/node
-
now you can use import aliases. example
import Button from '@components/elements/Button';