chore: Refactor build to simplify vite and esbuild

This commit is contained in:
Sidharth Vinod
2023-08-11 20:52:24 +05:30
parent edfc3933f9
commit 26001d63d6

View File

@@ -17,17 +17,12 @@ export default function jsonSchemaPlugin(): PluginOption {
} }
const jsonSchema = loadSchema(src, idAsUrl.pathname); const jsonSchema = loadSchema(src, idAsUrl.pathname);
if (idAsUrl.searchParams.get('only-defaults')) { return {
return { code: idAsUrl.searchParams.get('only-defaults')
code: getDefaults(jsonSchema), ? getDefaults(jsonSchema)
map: null, // no source map : getSchema(jsonSchema),
}; map: null, // no source map
} else { };
return {
code: getSchema(jsonSchema),
map: null, // provide source map if available
};
}
}, },
}; };
} }