@bunup/dts 0.14.26 → 0.14.27
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.
- package/dist/index.js +14 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -492,6 +492,20 @@ async function generateDts(entrypoints, options = {}) {
|
|
|
492
492
|
const { resolve, preferredTsconfig, naming } = options;
|
|
493
493
|
const cwd = options.cwd ? path2.resolve(options.cwd) : process.cwd();
|
|
494
494
|
const tsconfig = await loadTsConfig(cwd, preferredTsconfig);
|
|
495
|
+
if (options.inferTypes && !tsconfig.filepath) {
|
|
496
|
+
throw new Error(`The "inferTypes" option requires a tsconfig.json file. Please create a tsconfig.json file in your project root with at least a basic configuration:
|
|
497
|
+
|
|
498
|
+
` + `{
|
|
499
|
+
` + ` "compilerOptions": {
|
|
500
|
+
` + ` "target": "ESNext",
|
|
501
|
+
` + ` "module": "ESNext",
|
|
502
|
+
` + ` "moduleResolution": "bundler",
|
|
503
|
+
` + ` "declaration": true
|
|
504
|
+
` + ` }
|
|
505
|
+
` + `}
|
|
506
|
+
|
|
507
|
+
` + 'Alternatively, you can specify a custom path using the "preferredTsconfig" option.');
|
|
508
|
+
}
|
|
495
509
|
const nonAbsoluteEntrypoints = entrypoints.filter((entrypoint) => !path2.isAbsolute(entrypoint));
|
|
496
510
|
const resolvedEntrypoints = await getFilesFromGlobs(nonAbsoluteEntrypoints, cwd);
|
|
497
511
|
const absoluteEntrypoints = entrypoints.filter((entrypoint) => path2.isAbsolute(entrypoint));
|