RyanMyrvold / Performance-Decorators

Elevate your application's performance with 🚀 Performance Decorators! This comprehensive TypeScript library offers powerful tools for performance monitoring and optimization, making it easier to track and resolve bottlenecks in both Node.js and browser environments.
https://github.com/RyanMyrvold/Performance-Decorators
Other
35 stars 3 forks source link

can't find module declaraion #83

Closed tjx666 closed 3 months ago

tjx666 commented 3 months ago
image

Solution

use exports to define the sub module type definition, ref: https://github.com/tjx666/unplugin-detect-duplicated-deps/blob/main/package.json#L43

{
  "name": "performance-decorators",
  "version": "2.2.0",
  "description": "A set of decorators to help with performance testing",
  "main": "dist/index.js",
  "types": "dist/index.d.ts",
  "exports": {
    ".": {
      "types": "./dist/index.d.ts",
      "import": "./dist/index.js"
    },
    "./debugging": {
      "types": "./dist/debugging/index.d.ts",
      "import": "./dist/debugging/index.js"
    },
    "./optimization": {
      "types": "./dist/optimization/index.d.ts",
      "import": "./dist/optimization/index.js"
    }
  }
}