@sanity/pkg-utils
Version:
Simple utilities for modern npm packages.
53 lines (52 loc) • 1.49 kB
JavaScript
import path from "node:path";
function createApiExtractorConfig(options) {
const {
bundledPackages,
distPath,
exportPath,
filePath,
messages,
projectFolder,
mainEntryPointFilePath,
tsconfig,
tsconfigPath,
dtsRollupEnabled
} = options;
return {
apiReport: {
enabled: !1,
reportFileName: "<unscopedPackageName>.api.md"
},
bundledPackages,
// If `paths` are used for self-referencing imports (e.g. the module is named `sanity`, and the `sanity/structure` export is also importing from `sanity/router`),
compiler: tsconfig.options.paths ? {
overrideTsconfig: {
extends: tsconfigPath,
compilerOptions: {
// An empty object replaces whatever is in the original tsconfig file
paths: {}
}
}
} : { tsconfigFilePath: tsconfigPath },
docModel: {
enabled: !1,
apiJsonFilePath: path.resolve(distPath, `${exportPath}.api.json`)
},
dtsRollup: {
enabled: dtsRollupEnabled,
untrimmedFilePath: path.resolve(distPath, filePath)
// betaTrimmedFilePath: path.resolve(distPath, filePath.replace('.d.ts', '-beta.d.ts')),
// publicTrimmedFilePath: path.resolve(distPath, filePath.replace('.d.ts', '-public.d.ts')),
},
tsdocMetadata: {
enabled: !1
},
messages,
mainEntryPointFilePath,
projectFolder
};
}
export {
createApiExtractorConfig
};
//# sourceMappingURL=createApiExtractorConfig.js.map