I'm using Typescript with rollup with https://github.com/rollup/rollup-plugin-json and with TS 2.9 everything worked fine. TS 3 disables JSON modules with everything other than commonjs modules. Could this be changed for es2015 modules?
Looks like a duplicate of https://github.com/Microsoft/TypeScript/issues/25755
I filed a separate issue (and linked to the original one) since the other issue talks about amd.
--module esnext
I use webpack and I also have this requirement.
Me as well, I just want to TypeScript to load JSON and provide type intelligence to VSCode. That way TypeScript can enforce any code access of JSON object is valid.
@gamedevsam the workaround would be to target CommonJS in the tsconfig.json but whatever your build pipeline/bundler is that handles JSON, to ensure that it emits the TypeScript in the module format you prefer.
This is fixed in master.
Most helpful comment
--module esnextI use webpack and I also have this requirement.