Closed IlyaSemenov closed 1 year ago
Originally, I used declaration
in tsconfig.json
to generate the declaration file, which caused the problem.
In tag branch v1.3.3, I turned off declaration
and used rollup-plugin-dts
to generate index.d.ts
, and it worked normally.
The tsup
you recommended is indeed very convenient and easy to use, and it is adopted in v1.3.4.
Thanks
With 1.3.1, what is installed to node_modules with
npm install
is:dist/types/index.d.ts
has:Clearly, this is wrong. There is no
'./utils/types'
in the distribution to import from, and the actual types are non-functional. As a result, there is no type check when calling the plugin:I tried running
npm run build
in the latest master, but that generated even stranger result:So there is even no
dist/types/index.d.ts
, but instead a whole bunch of useless.d.ts
files.I propose to replace rollup with tsup which is a wrapper around rollup for creating library bundles, with very reasonable and unobtrusive defaults. Let me know what you think? Here's the
tsup.config.js
I'm using for my libraries:Then simply run
tsup
and it generates a fully working bundle atdist/
, including proper type bindings.