Skip to content

Commit

Permalink
[⚙️ : chore] 절대 경로 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
sryung1225 committed Dec 26, 2023
1 parent 5ce8f33 commit 06e4dad
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,9 @@ module.exports = {
],
'no-console': 'off',
},
settings: {
'import/resolver': {
typescript: {},
},
},
};
76 changes: 73 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
},
"devDependencies": {
"@svgr/rollup": "^8.1.0",
"@types/node": "^20.10.5",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"@types/styled-components": "^5.1.32",
Expand All @@ -32,6 +33,7 @@
"eslint": "^8.53.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.4",
Expand Down
12 changes: 12 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@
"module": "ESNext",
"skipLibCheck": true,

/* Static Path */
"baseUrl": "src",
"paths": {
"@/*": ["*"],
"@page/*": ["routes/*"],
"@compo/*": ["components/*"],
"@type/*": ["interfaces/*"],
"@util/*": ["utils/*"],
"@style/*": ["styles/*"],
"@img/*": ["assets/images/*"]
},

/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
Expand Down
18 changes: 18 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react-swc';
import svgr from '@svgr/rollup';
import viteImagemin from 'vite-plugin-imagemin';
import path from 'path';

// https://vitejs.dev/config/
export default defineConfig({
Expand Down Expand Up @@ -36,4 +37,21 @@ export default defineConfig({
},
}),
],
resolve: {
alias: [
{ find: '@', replacement: path.resolve(__dirname, 'src') },
{ find: '@page', replacement: path.resolve(__dirname, 'src/routes') },
{
find: '@compo',
replacement: path.resolve(__dirname, 'src/components'),
},
{ find: '@type', replacement: path.resolve(__dirname, 'src/interfaces') },
{ find: '@util', replacement: path.resolve(__dirname, 'src/utils') },
{ find: '@style', replacement: path.resolve(__dirname, 'src/styles') },
{
find: '@img',
replacement: path.resolve(__dirname, 'src/assets/images'),
},
],
},
});

0 comments on commit 06e4dad

Please sign in to comment.