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

<!-- agent-signals: reading_time_min: 1 · est_tokens: 89 · updated: 2026-07-28 -->
Related: [Delete directories](/guides/runtime/delete-directory.md), [Delete files](/guides/runtime/delete-file.md), [Import a JSON file](/guides/runtime/import-json.md), [Import a JSON5 file](/guides/runtime/import-json5.md), [Import a TOML file](/guides/runtime/import-toml.md), [Import a YAML file](/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 icon="/icons/typescript.svg" title="file.ts"
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.
