https://github.com/suptarr/react-rescript-template
Template of the React and ReScript
https://github.com/suptarr/react-rescript-template
react rescript
Last synced: 3 months ago
JSON representation
Template of the React and ReScript
- Host: GitHub
- URL: https://github.com/suptarr/react-rescript-template
- Owner: SupTarr
- Created: 2022-12-07T04:13:57.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T05:15:26.000Z (over 3 years ago)
- Last Synced: 2025-06-29T20:38:50.401Z (about 1 year ago)
- Topics: react, rescript
- Language: CSS
- Homepage: https://react-rescript-template.suptarr.vercel.app/
- Size: 330 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React ReScript Template
Template of the **React** and **ReScript** that build with **Vite**
---
## Getting Started
### Prerequisites
This is an example of how to list things you need to use the software and how to install them.
- npm:
```sh
npm install npm@latest -g
```
- Node JS:
### Installation
- Create React App with Vite:
```sh
# npm 6.x
npm create vite@latest my-app --template react
# npm 7+, extra double-dash is needed:
npm create vite@latest my-app -- --template react
cd my-app
npm install
```
- Install ReScript locally:
```sh
npm install rescript
```
- Add following dependency to your ReScript project:
```sh
npm install @rescript/react
```
- Then add the following setting to your existing `bsconfig.json`:
```json
{
"name": "your-project-name",
"sources": [
{
"dir": "src", // update this to wherever you're putting ReScript files
"subdirs": true
}
],
"package-specs": [
{
"module": "es6",
"in-source": true
}
],
"suffix": ".bs.js",
"reason": { "react-jsx": 3 },
"bs-dependencies": ["@rescript/react"]
}
```
* Add convenience npm scripts to `package.json`:
```json
"scripts": {
"res:build": "rescript",
"res:start": "rescript build -w"
}
```