# Import a HTML file as text (/docs/guides/runtime/import-html)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 87 · updated: 2026-07-28 -->
Related: [Delete directories](/docs/guides/runtime/delete-directory.md), [Delete files](/docs/guides/runtime/delete-file.md), [Import a JSON file](/docs/guides/runtime/import-json.md), [Import a JSON5 file](/docs/guides/runtime/import-json5.md), [Import a TOML file](/docs/guides/runtime/import-toml.md), [Import a YAML file](/docs/guides/runtime/import-yaml.md)

To import a `.html` file in Bun as a text file, use the `type: "text"` attribute in the import statement.

```ts file.ts icon="/icons/typescript.svg"
import html from "./file.html" with { type: "text" };

console.log(html); // <!DOCTYPE html><html><head>...
```

With hot module reloading or watch mode, Bun reloads whenever `./file.html` changes.
