tex-math-parser
tex-math-parser copied to clipboard
build process improvements
To improve the build process a bit, I installed vite, add a npm build script and a configuration file for vite.
When executing npm run build vite will build a cjs, es and iife version of the package and additionally a type declarations file is generated.
All this files are referenced in the package.json for package usage.
This PR is based on #8 !
This is likely useful for my need as well, since the current CJS-only build target can't be used from a web browser easily. An alternative solution with less code change would be to use the UMD target format instead in the current tsconfig.json file, but that still doesn't support ESM, unlike this PR.
I realized that I also have an older fork that covers this same issue in a different fashion, which I'll be creating a PR for soon once I finish some incomplete changes on it.