이슈
attachShadow가 웹컴포넌트와 관련된 키워드인데, IE에서 작동하지 않는다.(개발 서버만)
해결 방법
1) @webcomponents/shadydom 설치
2) src/polyfills.js
import "@webcomponents/shadydom";
3) next.config.js
webpack(config) {
const originalEntry = config.entry;
config.entry = async () => {
const entries = await originalEntry();
if (
entries["main.js"] &&
!entries["main.js"].includes("./src/polyfills.js")
) {
entries["main.js"].unshift("./src/polyfills.js");
}
return entries;
};
return config;
},
'JavaScript > Next.js' 카테고리의 다른 글
Next.js에서 운영배포시 console 제거 (0) | 2022.06.27 |
---|---|
Next.js url 네이밍 (0) | 2022.01.29 |
CRA와 비교한 Next.js의 장점 (0) | 2021.12.08 |
next-redux-wrapper가 필요한 이유 (0) | 2021.12.01 |
Data Fetching 번역 (0) | 2021.11.19 |