Skip to content
This repository has been archived by the owner on Nov 16, 2021. It is now read-only.
/ react-app-rewire-yaml Public archive

Add yaml-loader to a react-app-rewired config.

License

Notifications You must be signed in to change notification settings

hsz/react-app-rewire-yaml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-app-rewire-yaml

Dependency Status Dev Dependency Status Version Month Download License

Add yaml-loader together with yaml-lint-loader and json-loader to your create-react-app via react-app-rewired.

Installation

yarn add --dev react-app-rewire-yaml

OR

npm install --save-dev react-app-rewire-yaml

Usage

In your react-app-rewired configuration:

/* config-overrides.js */

const rewireYAML = require('react-app-rewire-yaml');

module.exports = function override(config, env) {
    // ...
    config = rewireYAML(config, env);
    // ...
    return config;
}

In your React application:

import data from './data.yaml'

const App = () => (
  <div>
    {data.key}
  </div>
);