declare module '*.json' { var _: any; export default _; }
then you can import mem from './mem.josn'
put this in some file that is included in tsconfig.json
now you can require .json
, this works for any other file formats (although you need a web package since nodejs cannot require them directly)
source share