farm
farm copied to clipboard
Farm client similar to Vite's. For backend integration.
What problem does this feature solve?
Currently I can't use Farm as I require Vite-like client functionality. I am working on backend integration and there are no plugins for my framework.
https://vitejs.dev/guide/backend-integration.html#backend-integration
With Vite I would:
- Programmatically add
@vite/client
script to the HTML page when in dev mode. - Programmatically add TS/SCSS/other assets into the HTML page when in dev mode. In production, this would be JS/CSS/etc.
- Start my app/Vite's dev server
- Have HMR working
Example HTML:
<!-- if development -->
<script type="module" src="http://localhost:5173/@vite/client"></script>
<script type="module" src="http://localhost:5173/main.ts"></script>
What does the proposed API look like?
This does not currently exist in Farm, but does in Vite. See https://vitejs.dev/guide/backend-integration.html#backend-integration.
Proposed:
<!-- if development -->
<script type="module" src="http://localhost:5173/@farmfe/client"></script>
<script type="module" src="http://localhost:5173/main.scss"></script>