Skip to content

Custom Build not picked up from TypeScript import #424

@Jonarod

Description

@Jonarod

Description

When imported from TypeScript file, the full build is imported instead of the custom one.

Additional details

  • ExifReader version: 4.23.7
  • Web browser and version: Chrome
  • Node version: 20.3.0

How to reproduce

  1. Create a TypeScript project using Vite
  2. Add some 'include tags in the exifreader field of package.json:
  "exifreader": {
    "include": {
      "exif": [
        "GPSLatitude",
        "GPSLatitudeRef",
        "GPSLongitude",
        "GPSLongitudeRef",
        "GPSAltitude",
        "GPSAltitudeRef"
      ]
    }
  }
  1. npm rebuild exifreader && rm -rf node_modules/.vite
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions