将 HTML 文件作为文本导入要在 Bun 中将 .html 文件作为文本文件导入,请在导入语句中使用 type: "text" 属性。 file.ts复制import html from "./file.html" with { type: "text" }; console.log(html); // <!DOCTYPE html><html><head>... 启用热模块重新加载或监视模式后,每当 ./file.html 发生变化时,Bun 都会重新加载。