UNPKG

bob-the-bundler

Version:
40 lines (39 loc) 1.32 kB
import zod from 'zod'; const BobConfigModel = zod.optional(zod.union([ zod.literal(false), zod.object({ commonjs: zod .boolean( /* { description: 'Enable CommonJS output creating a dual output ESM+CJS. If set to `false`, will generate only ESM output.', } */) .optional() .default(true), build: zod.union([ zod.literal(false), zod.optional(zod.object({ copy: zod.optional(zod.array(zod.string()) /* { description: 'Specify a list of files that should be copied the the output directory.', } */), })), ]), check: zod.optional(zod.union([ zod.literal(false), zod.object({ skip: zod.optional(zod.array(zod.string()) /* { description: 'Skip certain files from being checked. E.g. modules with side-effects.', } */), }), ])), }), ] /* { description: 'Bob configuration. Set this value to false in order to disable running bob on this package.', }, */)); export function getBobConfig(packageJson) { var _a; return BobConfigModel.parse((_a = packageJson.bob) !== null && _a !== void 0 ? _a : {}); }