tomjs / vite-plugin-vscode

用 vue/react 来开发 vscode extension webview ,支持 esm 和 cjs。Use vue/react to develop vscode extension webview, supporting esm and cjs.
MIT License
29 stars 1 forks source link

env.d.ts can not find type definition file #8

Closed derekrjones closed 2 months ago

derekrjones commented 3 months ago

in any of the examples, there is extension/env.d.ts https://github.com/tomjs/vite-plugin-vscode/blob/94057884d33f8da730561455e9d45d396817f32b/examples/react/extension/env.d.ts#L1 this seems to work fine in your workspace, I see it listed in 'files' in package.json but when used an external project env cannot be found. I'm guessing because its not part of the exports https://github.com/tomjs/vite-plugin-vscode/blob/94057884d33f8da730561455e9d45d396817f32b/package.json#L24-L34 It works if I include it in exports

  "exports": {
    ".": {
      "require": "./dist/index.js",
      "import": "./dist/index.mjs",
      "types": "./dist/index.d.ts"
    },
    "./env": {
      "types": "./env.d.ts"
    }
  },
tomgao365 commented 3 months ago

Please try v2.4.0

derekrjones commented 2 months ago

working great! thanks for the quick release!