Description
What happens and why it is wrong
I was struggling with generating JSDoc typings for a library using Microdundle. It generated index.d.ts
but none of the imported files. The root issue was missing "include" : ["src"]
(inspired by #211). I tried adding it to jsconfig.json
after scouring issues here as well as in Microbundle and TSDX. I finally tried renaming to tsconfig.json
and resolved my issue.
Suggested fix
Arguably this might belong in Microbundle if JSDoc typings aren't an intended use case for this plugin? Or just manually pass "jsconfig.json".
rollup-plugin-typescript2/src/parse-tsconfig.ts
Lines 13 to 17 in cffc4da
const getConfig = (name) => tsModule.findConfigFile(pluginOptions.cwd, tsModule.sys.fileExists, name);
const fileName =
getConfig(pluginOptions.tsconfig) ||
// if the value was provided, but no file, fail hard (previously `failed to open undefined`)
(pluginOptions.tsconfig && throw new Error(`failed to open '${pluginOptions.tsconfig}'`)) ||
getConfig("jsconfig.json");
Environment
Versions
From package-lock.json
(envinfo doesn't list nested dependencies):
npmPackages:
typescript: 4.5.5
rollup: 2.67.2
rollup-plugin-typescript2: 0.29.0
rollup.config.js
`rollup.config.js`:
https://github.com/developit/microbundle/blob/v0.14.2/src/index.js#L523-L556
tsconfig.json
`tsconfig.json`:
include
(described above) is the only key in tsconfig.json
.
package.json
`package.json`:
npmPackages:
microbundle: ^0.14.2 => 0.14.2