From ae6ea38f224fc5bde7afc8eb5f9a78a243cfa620 Mon Sep 17 00:00:00 2001 From: Sergey Yarkov Date: Sun, 17 Oct 2021 18:35:25 +0300 Subject: [PATCH] refactor: page naming --- src/App.tsx | 14 +++++++------- src/pages/404/{index.tsx => 404.tsx} | 0 src/pages/auth/{index.tsx => auth.tsx} | 0 src/pages/courses/{index.tsx => courses.tsx} | 0 src/pages/main/{index.tsx => main.tsx} | 0 src/pages/messages/{index.tsx => messages.tsx} | 0 src/pages/profile/{index.tsx => profile.tsx} | 0 src/pages/users/{index.tsx => users.tsx} | 0 vite.config.ts | 2 ++ 9 files changed, 9 insertions(+), 7 deletions(-) rename src/pages/404/{index.tsx => 404.tsx} (100%) rename src/pages/auth/{index.tsx => auth.tsx} (100%) rename src/pages/courses/{index.tsx => courses.tsx} (100%) rename src/pages/main/{index.tsx => main.tsx} (100%) rename src/pages/messages/{index.tsx => messages.tsx} (100%) rename src/pages/profile/{index.tsx => profile.tsx} (100%) rename src/pages/users/{index.tsx => users.tsx} (100%) diff --git a/src/App.tsx b/src/App.tsx index d99ad4d..67c395f 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -20,13 +20,13 @@ import PublicRoute from '@educt/components/PublicRoute'; /** * Pages */ -import AuthPage from '@educt/pages/auth'; -import NotFoundPage from '@educt/pages/404'; -const CoursesPage = React.lazy(() => import('@educt/pages/courses')); -const MainPage = React.lazy(() => import('@educt/pages/main')); -const MessagesPage = React.lazy(() => import('@educt/pages/messages')); -const ProfilePage = React.lazy(() => import('@educt/pages/profile')); -const UsersPage = React.lazy(() => import('@educt/pages/users')); +import AuthPage from '@educt/pages/auth/auth'; +import NotFoundPage from '@educt/pages/404/404'; +const CoursesPage = React.lazy(() => import('@educt/pages/courses/courses')); +const MainPage = React.lazy(() => import('@educt/pages/main/main')); +const MessagesPage = React.lazy(() => import('@educt/pages/messages/messages')); +const ProfilePage = React.lazy(() => import('@educt/pages/profile/profile')); +const UsersPage = React.lazy(() => import('@educt/pages/users/users')); const App = () => { const { diff --git a/src/pages/404/index.tsx b/src/pages/404/404.tsx similarity index 100% rename from src/pages/404/index.tsx rename to src/pages/404/404.tsx diff --git a/src/pages/auth/index.tsx b/src/pages/auth/auth.tsx similarity index 100% rename from src/pages/auth/index.tsx rename to src/pages/auth/auth.tsx diff --git a/src/pages/courses/index.tsx b/src/pages/courses/courses.tsx similarity index 100% rename from src/pages/courses/index.tsx rename to src/pages/courses/courses.tsx diff --git a/src/pages/main/index.tsx b/src/pages/main/main.tsx similarity index 100% rename from src/pages/main/index.tsx rename to src/pages/main/main.tsx diff --git a/src/pages/messages/index.tsx b/src/pages/messages/messages.tsx similarity index 100% rename from src/pages/messages/index.tsx rename to src/pages/messages/messages.tsx diff --git a/src/pages/profile/index.tsx b/src/pages/profile/profile.tsx similarity index 100% rename from src/pages/profile/index.tsx rename to src/pages/profile/profile.tsx diff --git a/src/pages/users/index.tsx b/src/pages/users/users.tsx similarity index 100% rename from src/pages/users/index.tsx rename to src/pages/users/users.tsx diff --git a/vite.config.ts b/vite.config.ts index 0dc76a8..b5f8321 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -24,6 +24,8 @@ export default defineConfig({ build: { rollupOptions: { output: { + entryFileNames: 'assets/[name]-[hash].js', + chunkFileNames: 'assets/[name].[hash].js', manualChunks: { ...renderChunks(dependencies), },