fix: extract build-id into seperate package to fix publishing (#3194)

Also makes it easier to replace during bundling.
This commit is contained in:
Marvin Hagemeister
2025-08-06 12:53:50 +02:00
committed by GitHub
parent ba2e01fec0
commit 83036d87ee
18 changed files with 41 additions and 16 deletions
+3 -1
View File
@@ -3,6 +3,8 @@ import type { Plugin } from "vite";
export function buildIdPlugin(): Plugin {
let buildId = "";
const regex = /^(jsr:)?@fresh\/build-id(@.*)?$/;
return {
name: "fresh:build-id",
async config(_, env) {
@@ -20,7 +22,7 @@ export function buildIdPlugin(): Plugin {
return true;
},
resolveId(id) {
if (id === "fresh/build-id") {
if (regex.test(id)) {
return `\0fresh/build-id`;
}
},