When trying to import this package from an ESModule TypeScript ecosystem, it won't work.
TypeScript shows an error stating that the corresponding types could not be found.
This is caused by the package.json setting the file for import calls to be index.mjs.
The setting mentioned before causes TypeScript to go search for the type declarations at gulp-esbuild/index.d.mts.
There are basically two ways on how to fix this:
A separate index.d.mts file can be created or - if both type declarations match - the types can be set to resolve to index.d.ts:
"exports": {
"types": "./index.d.ts",
"default": "./index.mjs"
}
Sadly, the type declarations do not match (index.js uses an export assignment, index.mjs uses a default export), so I think a separate type declaration file should be the proper solution.
I'll go create a PR concerning this matter.
When trying to import this package from an ESModule TypeScript ecosystem, it won't work.
TypeScript shows an error stating that the corresponding types could not be found.
This is caused by the
package.jsonsetting the file forimportcalls to beindex.mjs.The setting mentioned before causes TypeScript to go search for the type declarations at
gulp-esbuild/index.d.mts.There are basically two ways on how to fix this:
A separate
index.d.mtsfile can be created or - if both type declarations match - the types can be set to resolve toindex.d.ts:Sadly, the type declarations do not match (
index.jsuses an export assignment,index.mjsuses a default export), so I think a separate type declaration file should be the proper solution.I'll go create a PR concerning this matter.