將 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 都會重新載入。