Imagine in the world of typescript, whenever I write an import statement like this
import styles from "./styles.module.scss";
I want typescript to actually import this file ./styles.module.scss.json
The reason for this is that a JSON object containing mappings of classnames from CSS modules is created and saved to this file using an external script. Typings are also generated at ./styles.module.scss.d.ts
.
Unfortunately, I do not have access to webpack or Babel plugins. Is there a way to achieve this? I've heard about specifying a paths
configuration in compiler options, but I haven't been successful in making it work.