.html file in Bun as a text file, use the type: "text" attribute in the import statement.
./file.html file changes.
This feature was added in Bun v1.1.5..html file in Bun as a text file, use the type: "text" attribute in the import statement.
import html from './file.html' with {type: 'text'};
console.log(html); // <!DOCTYPE html><html><head>...
./file.html file changes.
This feature was added in Bun v1.1.5.Was this page helpful?