Skip to content

Commit

Permalink
all aliases implemented on imports
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmanueldaza committed Dec 26, 2024
1 parent c7b5d72 commit 002cdea
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/components/slideshow/Controls.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { faXmark, faDownload } from "@fortawesome/free-solid-svg-icons";
import styles from "@styles/Slideshow.module.css";
import { Button } from "../common/Button";
import { Button } from "@components/common/Button";

interface ControlsProps {
onClose: () => void;
Expand Down
2 changes: 1 addition & 1 deletion src/components/slideshow/FullscreenImage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styles from "@styles/Slideshow.module.css";
import animations from "@styles/animations.module.css";
import type { SlideImage } from "../../types";
import type { SlideImage } from "@types";

interface FullscreenImageProps {
image: SlideImage;
Expand Down
2 changes: 1 addition & 1 deletion src/components/slideshow/GithubButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { faGithub } from "@fortawesome/free-brands-svg-icons";
import { Button } from "../common/Button";
import { Button } from "@components/common/Button";

export const GithubButton: React.FC = () => (
<Button
Expand Down
18 changes: 9 additions & 9 deletions src/components/slideshow/Slideshow.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { useEffect, useRef, useState } from "react";
import { preloadImages } from "../../utils/imagePreloader";
import { useSlideshow } from "../../hooks/useSlideshow";
import { preloadImages } from "@utils/imagePreloader";
import { useSlideshow } from "@hooks/useSlideshow";
import styles from "@styles/Slideshow.module.css";
import type { SlideImage } from "../../types";
import { getImagePath } from "../../config/images";
import { Controls } from "./Controls";
import { FullscreenImage } from "./FullscreenImage";
import { GithubButton } from "./GithubButton";
import { Loading } from "./Loading";
import { Thumbnails } from "./Thumbnails";
import type { SlideImage } from "@types";
import { getImagePath } from "@config/images";
import { Controls } from "@components/slideshow/Controls";
import { FullscreenImage } from "@components/slideshow/FullscreenImage";
import { GithubButton } from "@components/slideshow/GithubButton";
import { Loading } from "@components/slideshow/Loading";
import { Thumbnails } from "@components/slideshow/Thumbnails";

const createImage = (id: string): SlideImage => ({
id: id,
Expand Down
2 changes: 1 addition & 1 deletion src/components/slideshow/Thumbnails.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styles from "@styles/Slideshow.module.css";
import type { SlideImage } from "../../types";
import type { SlideImage } from "@types";

interface ThumbnailsProps {
images: SlideImage[];
Expand Down
12 changes: 11 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,17 @@
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
"noFallthroughCasesInSwitch": true,
"baseUrl": ".",
"paths": {
"@types": ["src/types"],
"@types/*": ["src/types/*"],
"@components/*": ["src/components/*"],
"@utils/*": ["src/utils/*"],
"@styles/*": ["src/styles/*"],
"@config/*": ["src/config/*"],
"@hooks/*": ["src/hooks/*"]
}
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
Expand Down
11 changes: 6 additions & 5 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ export default defineConfig({
base: "/",
resolve: {
alias: {
"@types": path.resolve(__dirname, "./src/types"), // Alias @src to the src directory
"@components": path.resolve(__dirname, "./src/components"), // Alias @components to src/components
"@utils": path.resolve(__dirname, "./src/utils"), // Alias @utils to src/utils
"@styles": path.resolve(__dirname, "./src/styles"), //Alias @styles to src/styles
"@config": path.resolve(__dirname, "./src/config"), //Alias @config to src/config
"@types": path.resolve(__dirname, "src/types"),
"@components": path.resolve(__dirname, "src/components"),
"@hooks": path.resolve(__dirname, "src/hooks"),
"@utils": path.resolve(__dirname, "src/utils"),
"@styles": path.resolve(__dirname, "src/styles"),
"@config": path.resolve(__dirname, "src/config"),
},
},
build: {
Expand Down

0 comments on commit 002cdea

Please sign in to comment.