Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/redakker/reactlibsample
Simple React app with external library sample
https://github.com/redakker/reactlibsample
Last synced: 26 days ago
JSON representation
Simple React app with external library sample
- Host: GitHub
- URL: https://github.com/redakker/reactlibsample
- Owner: redakker
- Created: 2024-04-05T08:06:24.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-04-07T09:41:46.000Z (9 months ago)
- Last Synced: 2024-10-15T03:27:09.179Z (2 months ago)
- Language: TypeScript
- Size: 188 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple React application with a library
https://pauloe-me.medium.com/typescript-npm-package-publishing-a-beginners-guide-40b95908e69c
Unfortunately, a library cannot be outside of the “src“ folder of a React app. Moreover the path alias of a library is not straight forward. It is not enough to put into the tsconfig.json.
Here is nice article for howto. You need to use an addition npm package “crarco“
https://blog.logrocket.com/using-path-aliases-cleaner-react-typescript-imports/Install:
- go to the library folder (/src/libs/examplelib)
- npm i
- npm run build
- go to the root directory
- npm i
- npm run mystart#todo
- make possible to hot reload. Library can be watched, and when someting changes, then the main project reloads it. (start with --watch)