This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
- Configure the top-level
parserOptions
property like this:
export default {
// other rules...
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
}
- Replace
plugin:@typescript-eslint/recommended
toplugin:@typescript-eslint/recommended-type-checked
orplugin:@typescript-eslint/strict-type-checked
- Optionally add
plugin:@typescript-eslint/stylistic-type-checked
- Install eslint-plugin-react and add
plugin:react/recommended
&plugin:react/jsx-runtime
to theextends
list
This guide explains how to set up your frontend project to use the local Overlay SDK.
- PNPM installed on your system
- Frontend project (
overlay-interface-v2
) and SDK project (overlay-sdk
) in the same parent directory
-
Navigate to your frontend project directory:
cd path/to/overlay-interface-v2
-
Create a
pnpm-workspace.yaml
file in the frontend project root:touch pnpm-workspace.yaml
-
Add the following content to
pnpm-workspace.yaml
:packages: - '.' - '../overlay-sdk/packages/overlay-sdk'
This configuration includes your frontend project and the local SDK in the workspace.
-
Build the SDK: Navigate to the SDK directory and build it
-
Run PNPM install in your frontend project directory:
pnpm install
You can now import and use the SDK in your frontend code:
import { OverlaySDK } from 'overlay-sdk';
- Make changes to the SDK in the
overlay-sdk
directory. - Rebuild the SDK:
cd ../overlay-sdk/packages/overlay-sdk pnpm run build