You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeScript 환경에서 작업하고 있기 때문에 이에 대한 type을 선언하였습니다. types 폴더 하위에 다양한 type들을 정의할 수 있도록 작업하려 하였으나 기존에 작업하였던 "types": ["vite-plugin-svgr/client"],과 typesRoot 설정이 겹쳐 svg 관련 코드가 정상적으로 동작하지 않을 것을 고려하여 global로 관리할 수 있도록 하였습니다.
src 하위에 global.d.ts를 정의하여 아래와 같이 type을 정의하였습니다.
declare global {interfaceModernizrStatic{touchevents: boolean;}varModernizr: ModernizrStatic;}export{};
이를 적용하기 위해 tsconfig.json에 다음을 추가하였습니다.
"include": ["src/**/*", "src/global.d.ts"],
이를 바탕으로 Modernizr는 아래와 같이 활용할 수 있습니다.
{Modernizr.touchevents ? ("") : ( ...
The text was updated successfully, but these errors were encountered:
Feature Description
발표자 페이지 모바일 접근 막기
To-Do
추가 사항
modernizr 처리
상단 페이지에서
touch events
를 선택하여modernizr-custom.js
를 빌드하여 이를src
폴더에 위치시킵니다. 전역으로Modernizr
를 사용하기 위하여index.html
에script
태그를 이용하여 이를 불러옵니다.TypeScript 환경에서 작업하고 있기 때문에 이에 대한 type을 선언하였습니다.
types
폴더 하위에 다양한 type들을 정의할 수 있도록 작업하려 하였으나 기존에 작업하였던"types": ["vite-plugin-svgr/client"],
과typesRoot
설정이 겹쳐svg
관련 코드가 정상적으로 동작하지 않을 것을 고려하여global
로 관리할 수 있도록 하였습니다.src
하위에global.d.ts
를 정의하여 아래와 같이type
을 정의하였습니다.이를 적용하기 위해
tsconfig.json
에 다음을 추가하였습니다.이를 바탕으로
Modernizr
는 아래와 같이 활용할 수 있습니다.The text was updated successfully, but these errors were encountered: