I just want to import a file format .xyz
whose types are not fixed over all instances of the format:
import { Comment, Article, User } from "./Blog.xyz"
But what I get is the following:
TS2307: Cannot find module './Blog.xyz' or its corresponding type declarations.
What I did so far is the following:
There were several mistakes in my approach. For the missing types of Blog.xyz it is sufficient to add a .d.ts file that serves the file extension. Then the error disappears, but the values for this file keep missing.
For the values my approach was to add a custom webpack loader. Here several issues were blocking me:
A lot of stations were better error messages would help a lot.
If you are debugging you custom loader, I recommend the inspect-loader and the --stats option of webpack.