Repository: wxt-dev/wxt (TypeScript)

Issue:
Incorrect use of triple-slash directives
### Describe the bug

Both in code (e.g. [here](https://github.com/wxt-dev/wxt/blob/48a87aa352edbd0d095864fe1c14b50682f78dee/packages/wxt/src/core/generate-wxt-dir.ts#L220)) and documentation (e.g. [here](https://github.com/wxt-dev/wxt/blob/48a87aa352edbd0d095864fe1c14b50682f78dee/docs/guide/essentials/config/typescript.md?plain=1#L17)) `/// <reference types="..." />` is used when `/// <reference path="..." />` should have been used. Now while this for some reason seems to work in typescript@5.7, it does not in older versions like 4.9, where you'll get `Cannot find type definition file for './.wxt/wxt.d.ts'.ts(2688)`. Though I'm pretty certain this is not how it's supposed to be done even in 5.7, see TypeScript documentation [path](https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html#-reference-path-) and [types](https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html#-reference-types-).

### Reproduction

Any WXT project

### Steps to reproduce

In VS Code with the TypeScript version set to 4.9.5, add `/// <reference types="../.wxt/wxt.d.ts" />` at the top of a TypeScript file e.g. `entrypoints/context.ts`.

### System Info

```shell
Should be irrelevant but here you go:

  System:
    OS: Windows 11 10.0.26100
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
    Memory: 1.92 GB / 15.84 GB
  Binaries:
    Node: 18.20.4 - C:\Program Files\nodejs\node.EXE
    npm: 10.7.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (131.0.2903.112)
    Internet Explorer: 11.0.26100.1882
  npmPackages:
    wxt: 0.19.11 => 0.19.11

Since I did check the source code the issue should not have been fixed since 0.19.11.
```

### Used Package Manager

npm

### Validations

- [x] Read the [Contributing Guidelines](https://github.com/wxt-dev/wxt/blob/main/CONTRIBUTING.md).
- [x] Read the [docs](https://wxt.dev/guide/installation.html).
- [x] Check that there isn't [already an issue](https://github.com/wxt-dev/wxt/issues) that reports the same bug to avoid creating a duplicate.
- [x] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/wxt-dev/wxt/discussions) or join our [Discord Chat Server](https://discord.gg/ZFsZqGery9).
- [x] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.


Discussion: Good find, thanks for the info. I can get to this next week, or if you're willing, I'd accept a PR! You've already linked to all the relevant code, I don't think there's any other relevant lines that need changed.



Fix (patch):
diff --git a/docs/guide/essentials/config/typescript.md b/docs/guide/essentials/config/typescript.md
index be2208832..8d939e2e0 100644
--- a/docs/guide/essentials/config/typescript.md
+++ b/docs/guide/essentials/config/typescript.md
@@ -14,7 +14,7 @@ At a minimum, you need to create a TSConfig in your root directory that looks li
 Or if you're in a monorepo, you may not want to extend the config. If you don't extend it, you need to add `.wxt/wxt.d.ts` to the TypeScript project:
 
 ```ts
-/// <reference types="./.wxt/wxt.d.ts" />
+/// <reference path="./.wxt/wxt.d.ts" />
 ```
 
 ## Compiler Options
diff --git a/packages/wxt/src/core/generate-wxt-dir.ts b/packages/wxt/src/core/generate-wxt-dir.ts
index 4fe3c535c..e7d35949e 100644
--- a/packages/wxt/src/core/generate-wxt-dir.ts
+++ b/packages/wxt/src/core/generate-wxt-dir.ts
@@ -217,7 +217,7 @@ function getMainDeclarationEntry(references: WxtDirEntry[]): WxtDirFileEntry {
     } else if (ref.tsReference) {
       const absolutePath = resolve(wxt.config.wxtDir, ref.path);
       const relativePath = relative(wxt.config.wxtDir, absolutePath);
-      lines.push(`/// <reference types="./${normalizePath(relativePath)}" />`);
+      lines.push(`/// <reference path="./${normalizePath(relativePath)}" />`);
     }
   });
   return {