MBTI Test ํ๋ก์ ํธ๋ฅผ ๋ฐฐํฌํ๋ฉด์ ๊ฒช์๋ ๋ค์ํ ๋ฌธ์ ๋ค์ ํด๊ฒฐํ ๊ณผ์ ์ ์ ๋ฆฌํ์ต๋๋ค.
์ฒ์์๋ ๊ธฐ๋ณธ์ ์ธ ๋ฐฐํฌ ๊ณผ์ ์ ๋ฐ๋ผ๊ฐ์ง๋ง, ์ฌ๋ฌ ์ค๋ฅ๋ฅผ ๋ง๋ฌ๊ณ , ์ด๋ฅผ ํด๊ฒฐํ๋ฉด์ ๋ฐฐํฌ๋ฅผ ์์ ํ์์ผฐ์ต๋๋ค.
vercel build ์คํจ)โ ๏ธ ๋ฌธ์ :
[vite]: Rollup failed to resolve import "react-router-dom"
vite build ๊ณผ์ ์์ react-router-dom์ ์ฐพ์ ์ ์๋ค๋ ์ค๋ฅ ๋ฐ์ package.json์๋ ๋ถ๋ช
ํ react-router-dom์ด ์กด์ฌ ๐ ์์ธ ๋ถ์:
node_modules๊ฐ ์ ๋๋ก ์ค์น๋์ง ์์์ ๊ฐ๋ฅ์ฑ์ด ์์ react-router-dom ๋ฒ์ ์ด ๋๋ฌด ์ต์ ์ด๋ผ vite์์ ์ ์์ ์ผ๋ก ์ฒ๋ฆฌ๋์ง ์์ ์๋ ์์ โ
ํด๊ฒฐ ๋ฐฉ๋ฒ:
1๏ธโฃ ํจํค์ง ์ฌ์ค์น
rm -rf node_modules package-lock.json yarn.lock
yarn install
2๏ธโฃ react-router-dom์ ์์ ์ ์ธ ๋ฒ์ (6.4.0)์ผ๋ก ๋ค์ด๊ทธ๋ ์ด๋
yarn add react-router-dom@6.4.0
3๏ธโฃ Vercel ๋น๋ ์บ์ ์ญ์ ํ ๋ค์ ๋ฐฐํฌ
vercel --force
โก๏ธ ์ด๋ ๊ฒ ์ ์ฉํ ํ, vercel build๊ฐ ์ ์์ ์ผ๋ก ์งํ๋จ
vite build ์ Tailwind CSS Nesting ์ค๋ฅโ ๏ธ ๋ฌธ์ :
[vite:css][postcss] Nested CSS was detected, but CSS nesting has not been configured correctly.
โ
ํด๊ฒฐ ๋ฐฉ๋ฒ:
1๏ธโฃ tailwind.config.js์ Nesting ์ค์ ์ถ๊ฐ
module.exports = {
plugins: [require('tailwindcss/nesting')],
};
2๏ธโฃ PostCSS์๋ Nesting ์ง์ ์ถ๊ฐ (postcss.config.js)
module.exports = {
plugins: {
'postcss-nested': {},
tailwindcss: {},
autoprefixer: {},
},
};
โก๏ธ ๋ค์ vercel build ์คํ โ ์ ์์ ์ผ๋ก ๋น๋๋จ ๐
vercel.json ๋ฏธ์ค์ ๋ฌธ์ โ ๏ธ ๋ฌธ์ :
vite.config.js๋ฅผ ์ ๋๋ก ์ธ์ํ์ง ๋ชปํด ๋ฐฐํฌ ํ 404 ์ค๋ฅ ๋ฐ์ index.html์ ์ฐพ์ ์ ์๋ค๋ ์ค๋ฅ ๋ฐ์ โ
ํด๊ฒฐ ๋ฐฉ๋ฒ:
1๏ธโฃ vercel.json ํ์ผ์ ์์ฑํ๊ณ vite ์ค์ ์ถ๊ฐ
{
"build": {
"env": {
"NODE_ENV": "production"
},
"command": "vite build",
"outputDirectory": "dist"
},
"rewrites": [
{ "source": "/(.*)", "destination": "/index.html" }
]
}
2๏ธโฃ ๋ค์ ๋ฐฐํฌ
vercel deploy
โก๏ธ ๋ฐฐํฌ ํ ์ ์์ ์ผ๋ก ๋ผ์ฐํ ๋จ! โ
yarn install)react-router-dom ๋ฒ์ ๋ค์ด๊ทธ๋ ์ด๋ (6.4.0)tailwind.config.js, postcss.config.js ์์ )vercel.json ์ค์ ์ถ๊ฐ (๋น๋ ๋ช
๋ น์ด & ๋ผ์ฐํ
์ค์ )vercel --force๋ก ์บ์ ์์ด ๋ฐฐํฌ ์งํ