preactjs/wmr

Add native support for importing `.txt` files

marvinhagemeister opened this issue · 1 comments

Is your feature request related to a problem? Please describe.
Being anle to import a .txt file as a plain string.

Describe the solution you'd like

import text from "./foo.txt";
console.log(typeof text);
// logs: "string"

Describe alternatives you've considered
Custom plugins

Additional context
Ran into that with the examples on preact-www

Closing, while it seems nice initially @developit rightfully mentioned that doing so would inline the full string into the bundle. In most cases one would likely want to precompile the txt file.