I've been attempting to import readme files in TypeScript, but I keep encountering the error message "module not found."
Here is my TypeScript code:
import * as readme from "./README.md"; // I'm receiving an error saying module not found
I also tried adding to typings.d.ts:
declare module "*.md" {
const value: any;
export default value;
}
After some research, I discovered that TypeScript 2.0 introduced a feature called "Wildcard character in module names," which allows us to include any extension file.
I attempted to follow a similar example for JSON files (found at ), but unfortunately, it did not work for markdown files.
It's worth noting that I am not utilizing webpack or any loader, so I would prefer a solution solely within TypeScript.