`declarationDir` compiler option fails generation
See original GitHub issueI am trying to bundle type definitions, but get the following error TS6053: File 'src/index.d.ts' not found.
I run yarn dts-bundle-generator --external-imports=react --out-file lib/index.d.ts src/index.ts
and it fails with this error.
My src/index.ts
is just a simple import of reusable React components:
export {
Body,
Headline,
} from './Text';
src/Text/index.ts
content is
export { default as Body } from './Body';
export { default as Headline } from './Headline';
src/Text/Body.tsx
content is similar in both files:
import React, {
FC,
} from 'react';
import classNames from 'classnames';
import { TextProps } from './TextProps';
import styles from './Text.css';
const Body: FC<TextProps> = ({
...
}) => (
<span ... />
);
export default Body;
Why does it need src/index.d.ts
at all?
I works fine if I run tsc
to generate definition file for each ts/tsx file and use dts-bundle-generator later with
yarn dts-bundle-generator --external-imports=react --out-file lib/index.d.ts lib/src/index.d.ts
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
TSConfig Reference - Docs on every TSConfig option
Specifies an allowlist of files to include in the program. An error occurs if any of the files can't be found. {. "...
Read more >rollup esm and umd builds, with typescript plugin and ...
I had a first error because of the configuration propery only rollup-plugin-typescript2 understands: "(!) Plugin typescript: @rollup/plugin- ...
Read more >Warning Options - Using the GNU Compiler Collection (GCC)
Make all warnings into errors. -Werror= Make the specified warning into an error. The specifier for a warning is appended, for example -Werror ......
Read more >rollup-plugin-typescript2 - npm.io
This plugin inherits all compiler options and file lists from your tsconfig.json file. ... declarationDir : Rollup's output.file or output.dir (unless ...
Read more >Integrating TypeScript with Webpack | by Uday Hiwarale
If you haven't read the TypeScript Compilation lesson, ... to true in the tsconfig.json along with declarationDir compiler-option.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The fix is just published with 5.7.0 version.
It works. Thank you for fixing.