Generate declarations as index.d.ts instead of highlight.d.ts #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "index-d-ts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I was having trouble building declarations for my project, with the following error:
(I am using @codemirror/language@0.20.1 and @lezer/highlight@0.16.0.)
I am getting this error because the declarations for
@lezer/highlight/dist/index.jsare in@lezer/highlight/dist/highlight.d.ts, not@lezer/highlight/dist/index.d.ts, and it looks like my bundler expects the declarations to have the same name as the JS file.This PR fixes it by renaming
src/highlight.tstosrc/index.ts, which will rename the.d.tsfile. (I could not find a way to change the name of the declarations file using config alone).Seems it is ignoring the
typesfield in package.json, which sounds like an issue in the bundler. I generally don't accept patches that work around bugs in other software, since those are really not my responsibility.Alright, sounds fair!
Pull request closed