A minimal, batteries‑included starter to build and ship Sankhya ERP HTML5 components using React 19 and Vite 7 — with JSP scaffold, stable asset filenames, alias support, Tailwind (optional), and a ZIP bundle ready for import in Sankhya.
- React 19 + Vite 7 with TypeScript
- Stable asset names for Sankhya (e.g.
assets/app.js,assets/index.css) - Alias
@→srcfor clean imports (Vite + TS configured) - JSP scaffold that loads the built app inside Sankhya as HTML5 component
- Relative assets (
base: "./") to support${BASE_FOLDER}paths - Optional Tailwind via
@tailwindcss/vite - Auto ZIP after build (
dist/sankhya-component.zip) usingvite-plugin-zip-pack
pnpm install
pnpm devOpen http://localhost:5173.
Main entry points:
src/main.tsx— mounts the appsrc/app/app.tsx— demo UIindex.html— html demo view
pnpm buildThis produces:
dist/index.jsp— page to be served by Sankhyadist/assets/app.js— bundled JS (ESM)dist/assets/index.css— stylesdist/assets/*.svg— logos and images (not inlined)dist/sankhya-component.zip— ready to import in Sankhya
Copy the entire dist/ (or only the ZIP) to your HTML5 component folder in Sankhya.
src/
app/app.tsx # Demo component
assets/* # Logos and images
global.css # Global styles (Tailwind ready)
main.tsx # App entry
services/sankhya/ # Sankhya service layer (API, Database, Page utils)
public/
index.jsp # JSP scaffold used in Sankhya
vite.config.ts # Build config (stable outputs, base "./", zip pack)
- Sankhya Service Layer Documentation — Complete guide to the service layer, including API reference, usage examples, and React Context integration.
pnpm dev— start Vite dev serverpnpm build— typecheck + production build + ZIPpnpm preview— preview production build
- Assets use relative URLs (
base: "./") so${BASE_FOLDER}works in JSP. - Small images are not inlined (
assetsInlineLimit: 0) so they exist as physical files indist/assets. - If your Sankhya environment doesn’t support
<script type="module">, add@vitejs/plugin-legacyand load the legacy bundle inindex.jsp.
Logos aren’t loading inside Sankhya
- Ensure you’re using the built files from
dist/(not the dev server URLs). - Check that your component path resolves
${BASE_FOLDER}/assets/*correctly.
How do I change the output names?
- See
vite.config.ts → build.rollupOptions.output.
PRs are welcome! Please lint and keep changes focused.
MIT © 2025
Built with ☕ by M.S.