Replace serializable object literals with JSON.parse().
π Perf tip: if your web app ships large JSON-like configuration as JavaScript object literals, consider using JSON.parse instead. Itβs much faster, especially for cold loads! https://twitter.com/mathias/status/1143551692732030979?s=20
npm install --save-dev babel-plugin-transform-object-literals
Then add transform-object-literals
to your .babelrc
:
{
"plugins": ["transform-object-literals"]
}
cd examples
npm install
npm run build
node ./output.js
PRs welcome! Make sure npm test
before making pull-request.
git clone https://github.com/uetchy/babel-plugin-transform-object-literals
cd babel-plugin-transform-object-literals
npm install
npm test