Tweak Create React App via React App Rewire to best integrate with dapp development.
$> npm install parity-react-dapp --save-dev
Add to your package.json
file this script:
"scripts": {
"init": "parity-react-dapp init"
}
$> npm run init
This will add the base files (eslint config, gitignore file, etc.) to your project,
add will add the required scripts to your package.json
file.
You must have an src/index.js
file that exports your default component, eg:
/* src/index.js */
import React, { Component } from 'react';
export default class App extends Component {
render () {
return (
<div>
HELLO
</div>
);
}
}
You get React Hot Reloading for free, without any configuration needed!
You can use these scripts just as you would with Create React App:
$> npm start # Start the dev environment
$> npm build # Build your project
There are a few more scripts included in here
You have included JS and CSS linting:
$> npm run lint:js # Lint your Javascript files with eslint
$> npm run lint:css # Lint your CSS files with stylelint
$> npm run lint # Run both linters