diff --git a/gatsby-config.ts b/gatsby-config.ts index 81bd130..e579ee7 100644 --- a/gatsby-config.ts +++ b/gatsby-config.ts @@ -70,6 +70,20 @@ const config: GatsbyConfig = { policy: [{ userAgent: '*', allow: '/' }], }, }, + { + resolve: `gatsby-plugin-alias-imports`, + options: { + alias: { + '@src': 'src', + '@api': 'src/api', + '@components': 'src/components', + '@images': 'src/images', + '@pages': 'src/pages', + '@styles': 'src/styles', + }, + extensions: [], + }, + }, ], }; diff --git a/package-lock.json b/package-lock.json index 618e1c0..fc35007 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,6 +28,7 @@ "@types/node": "^20.11.19", "@types/react": "^18.2.55", "@types/react-dom": "^18.2.19", + "gatsby-plugin-alias-imports": "^1.0.5", "typescript": "^5.3.3" } }, @@ -8498,6 +8499,18 @@ "@parcel/core": "^2.0.0" } }, + "node_modules/gatsby-plugin-alias-imports": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/gatsby-plugin-alias-imports/-/gatsby-plugin-alias-imports-1.0.5.tgz", + "integrity": "sha512-q58JrSjuVNh4NApamqElR0zqwm55FOb9vFAVb2i2ftPRu0uYzWJkbOz2IN3vSw7a+5PmGzX7VL8XDFXlNHrMNA==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.2.0" + }, + "peerDependencies": { + "gatsby": ">2.0.0" + } + }, "node_modules/gatsby-plugin-google-gtag": { "version": "5.13.1", "resolved": "https://registry.npmjs.org/gatsby-plugin-google-gtag/-/gatsby-plugin-google-gtag-5.13.1.tgz", @@ -22819,6 +22832,15 @@ "@parcel/transformer-json": "2.8.3" } }, + "gatsby-plugin-alias-imports": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/gatsby-plugin-alias-imports/-/gatsby-plugin-alias-imports-1.0.5.tgz", + "integrity": "sha512-q58JrSjuVNh4NApamqElR0zqwm55FOb9vFAVb2i2ftPRu0uYzWJkbOz2IN3vSw7a+5PmGzX7VL8XDFXlNHrMNA==", + "dev": true, + "requires": { + "@babel/runtime": "^7.2.0" + } + }, "gatsby-plugin-google-gtag": { "version": "5.13.1", "resolved": "https://registry.npmjs.org/gatsby-plugin-google-gtag/-/gatsby-plugin-google-gtag-5.13.1.tgz", diff --git a/package.json b/package.json index cfbc126..c1b4492 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "gatsby" ], "scripts": { - "develop": "gatsby develop", + "dev": "gatsby develop", "start": "gatsby develop", "build": "gatsby build", "serve": "gatsby serve", @@ -36,6 +36,7 @@ "@types/node": "^20.11.19", "@types/react": "^18.2.55", "@types/react-dom": "^18.2.19", + "gatsby-plugin-alias-imports": "^1.0.5", "typescript": "^5.3.3" } } diff --git a/src/components/Alliance/AllianceContact/AllianceContact.tsx b/src/components/Alliance/AllianceContact/AllianceContact.tsx index 8504591..9b909ed 100644 --- a/src/components/Alliance/AllianceContact/AllianceContact.tsx +++ b/src/components/Alliance/AllianceContact/AllianceContact.tsx @@ -3,8 +3,8 @@ import * as styles from './AllianceContact.module.scss'; import AllianceInputField from '../BaseComponents/AllianceInputField'; import { StaticImage } from 'gatsby-plugin-image'; import AllianceDropdown from '../AllianceDropdown/AllianceDropdown'; -import { ContactInfoType } from '../../../api/types'; -import allianceApi from '../../../api/alliance'; +import { ContactInfoType } from '@api/types'; +import allianceApi from '@api/alliance'; const PlatformList = ['업체 홈페이지', '네이버 블로그', '인스타그램', '구글 폼', '전화예약']; const { applyContactInfo } = allianceApi(); diff --git a/src/components/common/ApplyLink.tsx b/src/components/Common/ApplyLink.tsx similarity index 100% rename from src/components/common/ApplyLink.tsx rename to src/components/Common/ApplyLink.tsx diff --git a/src/components/common/NavbarMenuLink.tsx b/src/components/Common/NavbarMenuLink.tsx similarity index 100% rename from src/components/common/NavbarMenuLink.tsx rename to src/components/Common/NavbarMenuLink.tsx diff --git a/src/components/Layout/Layout.tsx b/src/components/Layout/Layout.tsx index bdd9310..e2068ef 100644 --- a/src/components/Layout/Layout.tsx +++ b/src/components/Layout/Layout.tsx @@ -3,7 +3,7 @@ import Nav from './Nav/Nav'; import * as styles from './Layout.module.scss'; import Footer from './Footer/Footer'; import { Link } from 'gatsby'; -import ApplyLink from '../common/ApplyLink'; +import ApplyLink from '../Common/ApplyLink'; type LayoutProps = { children: React.ReactNode; }; @@ -14,11 +14,9 @@ const Layout = ({ children }: LayoutProps) => {