From 080665ddfbcf1e7ac56deb3edeaa1f3dfeadf481 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E9=98=B3?= <3311118881@qq.com> Date: Thu, 25 Jul 2024 20:28:03 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE@/=E5=BF=AB=E6=8D=B7=E8=B7=AF?= =?UTF-8?q?=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.tsx | 4 ++-- tsconfig.json | 5 +++++ vite.config.js | 6 ++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main.tsx b/src/main.tsx index 89d6fe8..b872119 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -2,8 +2,8 @@ import React from 'react'; import ReactDOM from 'react-dom/client'; import { BrowserRouter as Router } from 'react-router-dom'; import App from './App'; -import './styles/index.css'; -import './styles/satoshi.scss'; +import '@/styles/index.css' +import '@/styles/satoshi.scss'; import 'jsvectormap/dist/css/jsvectormap.css'; import 'flatpickr/dist/flatpickr.min.css'; diff --git a/tsconfig.json b/tsconfig.json index 7ed3e65..9537225 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,6 +5,11 @@ "module": "ESNext", "skipLibCheck": true, + "baseUrl": ".", + "paths": { + "@/*": ["src/*"] + }, + /* Bundler mode */ "moduleResolution": "bundler", "allowImportingTsExtensions": true, diff --git a/vite.config.js b/vite.config.js index 5a33944..c0d936a 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,7 +1,13 @@ import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' +import path from 'path'; // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], + resolve: { + alias: { + '@': path.resolve(__dirname, './src') + }, + } })