The TC39 proposal import-text and whatwg/html#11933 are adding support for a new import type:
import text from "path/to/file.txt" with { type: "text" };
This would parse the imported file as UTF-8, and make its value available as a JS String.
Tests for this are being added in tc39/test262#4607 and web-platform-tests/wpt#56812.
In Deno, support for this is already available with --unstable-raw-imports.
The TC39 proposal import-text and whatwg/html#11933 are adding support for a new import type:
This would parse the imported file as UTF-8, and make its value available as a JS String.
Tests for this are being added in tc39/test262#4607 and web-platform-tests/wpt#56812.
In Deno, support for this is already available with
--unstable-raw-imports.