diff --git a/e2e/tests/auto-imports.test.ts b/e2e/tests/auto-imports.test.ts
index 578d9661..042ad14e 100644
--- a/e2e/tests/auto-imports.test.ts
+++ b/e2e/tests/auto-imports.test.ts
@@ -44,7 +44,7 @@ describe('Auto Imports', () => {
".wxt/wxt.d.ts
----------------------------------------
// Generated by wxt
- ///
+ ///
///
///
///
@@ -83,7 +83,7 @@ describe('Auto Imports', () => {
".wxt/wxt.d.ts
----------------------------------------
// Generated by wxt
- ///
+ ///
///
///
///
diff --git a/e2e/tests/typescript-project.test.ts b/e2e/tests/typescript-project.test.ts
index 468f49e6..3910cda6 100644
--- a/e2e/tests/typescript-project.test.ts
+++ b/e2e/tests/typescript-project.test.ts
@@ -227,7 +227,7 @@ describe('TypeScript Project', () => {
".wxt/wxt.d.ts
----------------------------------------
// Generated by wxt
- ///
+ ///
///
///
///
diff --git a/package.json b/package.json
index 2eb7e8fd..f3f96a62 100644
--- a/package.json
+++ b/package.json
@@ -76,6 +76,9 @@
"types": "./dist/storage.d.cts",
"default": "./dist/storage.cjs"
}
+ },
+ "./vite-builder-env": {
+ "types": "./dist/vite-builder-env.d.ts"
}
},
"scripts": {
diff --git a/scripts/build.ts b/scripts/build.ts
index 105d395d..6d371407 100644
--- a/scripts/build.ts
+++ b/scripts/build.ts
@@ -106,6 +106,9 @@ await spinnerPMap(config).catch((err) => {
process.exit(1);
});
+// Copy "public" files that need shipped inside WXT
+await fs.copyFile('src/vite-builder-env.d.ts', 'dist/vite-builder-env.d.ts');
+
spinner.clear().stop();
const duration = Date.now() - startTime;
diff --git a/src/core/utils/building/generate-wxt-dir.ts b/src/core/utils/building/generate-wxt-dir.ts
index 729d51af..654bb60a 100644
--- a/src/core/utils/building/generate-wxt-dir.ts
+++ b/src/core/utils/building/generate-wxt-dir.ts
@@ -180,7 +180,7 @@ async function writeMainDeclarationFile(
filePath,
[
'// Generated by wxt',
- `/// `,
+ `/// `,
...references.map(
(ref) =>
`/// `,
diff --git a/src/vite-builder-env.d.ts b/src/vite-builder-env.d.ts
new file mode 100644
index 00000000..11f02fe2
--- /dev/null
+++ b/src/vite-builder-env.d.ts
@@ -0,0 +1 @@
+///