Cannot find module './assets/css/xxx.scss' or its corresponding type declarations

https://stackoverflow.com/questions/64732623/react-typescript-cannot-find-module-or-its-corresponding-type-declaration


css.d.ts

declare module '*.scss' {
  const css: { [key: string]: string };
  export default css;
}
declare module '*.sass' {
  const css: { [key: string]: string };
  export default css;
}
declare module 'react-markup';
declare module '*.webp';
declare module '*.png';
declare module '*.jpg';
declare module '*.jpeg';

tsconfig.json

{
    "include": ["src", "types", "css.d.ts"],
     ...  
}

 

posted @ 2022-04-24 18:23  Redchar  阅读(922)  评论(0编辑  收藏  举报