You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some Typescript file: import ExifReader from 'exifreader';
What I expected would happen:
I expected to see only the tags I included.
What really happened:
Every tags were loaded instead.
My guess is that instead of looking for the node_modules/exifreader/dist/exif-reader.js file, TypeScript directly tries to load node_modules/exifreader/exif-reader.d.ts and then loads the full build instead of the custom build.
The text was updated successfully, but these errors were encountered:
I think the issue is that it will always look at the module property in package.json which points to the main entry file, not the built file. You could try changing the compilerOptions.moduleResolution value in your tsconfig.json and see if that helps.
The package.json should use the exports property instead which could help solve this issue, but I think that is an update for the next major version.
Description
When imported from TypeScript file, the full build is imported instead of the custom one.
Additional details
How to reproduce
'include
tags in theexifreader
field ofpackage.json
:npm rebuild exifreader && rm -rf node_modules/.vite
import ExifReader from 'exifreader';
What I expected would happen:
I expected to see only the tags I included.
What really happened:
Every tags were loaded instead.
My guess is that instead of looking for the
node_modules/exifreader/dist/exif-reader.js
file, TypeScript directly tries to loadnode_modules/exifreader/exif-reader.d.ts
and then loads the full build instead of the custom build.The text was updated successfully, but these errors were encountered: