react-app-rewire-yaml-flat
v1.0.0
Published
Add yaml-flat-loader to a react-app-rewired config.
Downloads
71
Maintainers
Readme
react-app-rewire-yaml-flat
Add yaml-flat-loader together with json-loader to your create-react-app via react-app-rewired.
Installation
yarn add --dev react-app-rewire-yaml-flat
OR
npm install --save-dev react-app-rewire-yaml-flat
Usage
In your react-app-rewired configuration:
/* config-overrides.js */
const rewireYamlFlat = require('react-app-rewire-yaml-flat');
module.exports = function override(config, env) {
// ...
config = rewireYamlFlat(config, env);
// ...
return config;
}
In your React application:
import data from './data.yaml'
const App = () => (
<div>
{data['key.subkey']}
</div>
);