preactjs / wmr

👩‍🚀 The tiny all-in-one development tool for modern web apps.

Home Page:https://wmr.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add native support for importing `.txt` files

marvinhagemeister opened this issue · 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.