Does the ES modules implementation support importing JSON files?
I've found in the Node.js ES Modules docs that currently importing JSON is only supported in the CommonJS mode and the flag --experimental-json-modules
is required for importing JSON files in ES modules.
Assuming an index.mjs with
import packageConfig from './package.json';
The --experimental-json-modules flag is needed for the module to work.
node index.mjs # fails
node --experimental-json-modules index.mjs # works