@sanity/pkg-utils 7.8.8-canary.0 → 7.8.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -775,27 +775,23 @@ function createApiExtractorConfig(options) {
775
775
  tsconfig,
776
776
  tsconfigPath,
777
777
  dtsRollupEnabled
778
- } = options, workaroundModulePreserve = tsconfig.options.module === ts__default.default.ModuleKind.Preserve, workaroundPaths = !!tsconfig.options.paths, overrideTsconfig = {
779
- extends: tsconfigPath,
780
- compilerOptions: {}
781
- };
782
- return workaroundModulePreserve && Object.assign(overrideTsconfig.compilerOptions, {
783
- // Set the equivalent options to `module: 'Preserve'`
784
- // https://github.com/microsoft/TypeScript/pull/56785/files?file-filters%5B%5D=.js&file-filters%5B%5D=.json&file-filters%5B%5D=.symbols&file-filters%5B%5D=.ts&file-filters%5B%5D=.types&show-viewed-files=true#diff-31d3c12bafea26bc9e8c8a77920c41af0c593206442add70c45a06c063767445
785
- module: "ESNext",
786
- moduleResolution: "Bundler",
787
- esModuleInterop: !0,
788
- resolveJsonModule: !0
789
- }), workaroundPaths && Object.assign(overrideTsconfig.compilerOptions, {
790
- // An empty object replaces whatever is in the original tsconfig file
791
- paths: {}
792
- }), {
778
+ } = options;
779
+ return {
793
780
  apiReport: {
794
781
  enabled: !1,
795
782
  reportFileName: "<unscopedPackageName>.api.md"
796
783
  },
797
784
  bundledPackages,
798
- compiler: workaroundModulePreserve || workaroundPaths ? { overrideTsconfig } : { tsconfigFilePath: tsconfigPath },
785
+ // 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`),
786
+ compiler: tsconfig.options.paths ? {
787
+ overrideTsconfig: {
788
+ extends: tsconfigPath,
789
+ compilerOptions: {
790
+ // An empty object replaces whatever is in the original tsconfig file
791
+ paths: {}
792
+ }
793
+ }
794
+ } : { tsconfigFilePath: tsconfigPath },
799
795
  docModel: {
800
796
  enabled: !1,
801
797
  apiJsonFilePath: path__default.default.resolve(distPath, `${exportPath}.api.json`)