I'm running into an build issue after the v2 update when doing a production build with vite (in a sveltekit project). I think the problem is that fs is used in client-side code:
[vite-plugin-sveltekit-compile] "readFileSync" is not exported by "__vite-browser-external", imported by "node_modules/json-schema-to-zod/dist/esm/utils/cliTools.js".
file: ./node_modules/json-schema-to-zod/dist/esm/utils/cliTools.js:1:19
1: import { statSync, readFileSync } from "fs";
^
2: export function parseArgs(params, args, help) {
3: const result = {};
error during build:
RollupError: "readFileSync" is not exported by "__vite-browser-external", imported by "node_modules/json-schema-to-zod/dist/esm/utils/cliTools.js".
Problem is resolved when removing
export * from "./utils/cliTools.js"
from src/index.ts. Is it necessary to export the cliTools to library users?
I'm running into an build issue after the v2 update when doing a production build with vite (in a sveltekit project). I think the problem is that
fs
is used in client-side code:Problem is resolved when removing
from
src/index.ts
. Is it necessary to export the cliTools to library users?Thanks for the great library!