์๋ฒ์ฌ์ด๋ ๋ ๋๋ง ์ ์ฉ ํ, css๊ฐ ํ๋ ธ๋ค๊ฐ ๋ค์ ์ ์ฉ๋๋๊ฒ ๊ฐ์์.
์.. ๋๋์ด ๋๋ค์ ๋๋ฌด ๊ฐ์ฌํฉ๋๋ค!!๋ฉฐ์น ์งธ ๊ณ ์ํ๋๋ฐ ์ด๋ ๊ฒ ๋๋๊น ๋๋ฌด ์ข์๋ฐ, ๋๋ฌด ํ๋ฌดํ๊ธฐ๋ ํ๋ค์..ใ
ใ
์ ๋ ์ฌํ๊ป next config ์ค์ ๊ณผ babel ์ชฝ๋ง ๋ณด๊ณ ์์๋๋ฐ์ด๋ ๊ฒ ๋ฐฉ๋ฒ์ ์ฐพ์๋ด๊ณ ์ ์ฉํ๋๊ฒ์ด ์ค๋ ฅ์ด๊ฒ ์ฃ ? ์์ผ๋ก ๋ ์ด์ฌํ ํ๊ฒ ์ต๋๋ค!์ ๊ทธ๋ฆฌ๊ณ ํน์ ๋ชฐ๋ผ์ ์ฝ๋ ๋จ๊ฒจ๋ด
๋๋ค.babel ๋์ swc๋ฅผ ์ด์ฉํ์ต๋๋ค. (ํน์ babel ์ค์ ์ผ๋ก ์๋์๋ ๋ถ๋ค์ ์ํด์..)npm install --save-dev @swc/plugin-styled-components @swc/coreroot ํด๋ ์์ .swcrc ๋ง๋ค๊ธฐ // .swcrc { "jsc": { "experimental": { "plugins": [ [ "@swc/plugin-styled-components", { "displayName": true, "ssr": true } ] ] } } }next.config ํ์ผ์ ์ค์ ์ถ๊ฐswcMinify: true,compiler: { styledComponents: true, },** ํน์ .babelrc๋ฅผ ์ญ์ ํ์ง ์๊ณ ๋จ๊ฒจ๋๊ณ swc๋ฅผ ์ฌ์ฉํ๋ ค๊ณ ํ๋ฉด ์ด๋ฐ ๋ฌธ๊ตฌ๊ฐ ๋ณด์
๋๋ค.'Disabled SWC as replacement for Babel because of custom Babel configuration ".babelrc" https://nextjs.org/docs/messages/swc-disabled ''compiler options in next.config.js will be ignored while using Babel https://nextjs.org/docs/messages/ignored-compiler-options'๋ฐ๋ฒจ ์
์ ํ์ผ์ ๋จ๊ฒจ๋๊ณ ์ถ์ผ์๋ค๋ฉด, ์๋ ์ค์ ๋ next.config ํ์ผ์ ์ถ๊ฐํด์ฃผ์๋ฉด ๋ฉ๋๋ค.experimental: { forceSwcTransforms: true, }