I created Typescript project with webpack, following this tutorial. As I have a lot of modules, I added index.d.ts to my src/components folder where I export all my modules:
export {Module1} from "./Module1";
export {Module2} from "./Module2";
export {Module3} from "./Module3";
I added index.d.ts to tsconfig.json files:
"files": [
"./src/components/index.d.ts"
]
Then, in index.tsx, which is in src folder, I import:
import * as MyModule from "./components/";
Code hinting works fine, so I suppose all paths are OK. However when I run webpack, I get this error:
Module not found: Error: Cannot resolve directory './components'
As I understand, webpack doesn't find this index.d.ts file. I tried adding d.ts to webpack.config.js extensions, like described here, but then I've got a different error message. Am I missing something?