What is the correct posture for using cssModule to build a React + Typescript environment?

Update

currently imports resources through require . The test does not need to generate a .d.ts file and works normally. We"ll study this piece later.

problem description

I currently add module that supports scss based on the official creat-react-app , but there is a confusion that every new * *. Module.scss , when I quote in tsx , I will create a new * * .module.scss.d.ts , which will look like this in the folder:

clipboard.png

clipboard.png

import

//

loader:


cssModule

clipboard.png

but the d.ts with many file structures is strange, is it normal?

May.12,2022

what a big deal.

  https://www.tslang.cn/docs/ha...

I also find typescript's .d.ts annoying. But there is no way, but we need this declaration file when we introduce an external module. Otherwise, there is no way to import

Menu