I am trying to use babel standalone and Babel.transform with a json file but getting an error. Does anyone know what config options I could use? The following just results in an empty object when I try to import the json file in my actual code.
any json file...
{
"name": "value 1"
}
import code from './myJsonFile.json';
const OPTIONS = {
plugins: [
'proposal-json-strings',
'transform-modules-commonjs',
],
};
const code = Babel.transform(code, OPTIONS);