Intent to protoype: Importing text modules

166 views
Skip to first unread message

Eemeli Aro

unread,
Apr 15, 2026, 10:41:42 AM (9 days ago) Apr 15
to dev-pl...@mozilla.org
Summary:
  Add a new 'text' value for JavaScript's import type attribute,
  with which a file may be imported as a string value:

    import text from "path/to/file.txt" with { type: "text" };

Bug:

Specifications:
Platform Coverage:
  all

Preference:
  javascript.options.experimental.import_text

DevTools Bug:
  n/a

Extensions Bug:
  n/a

Use Counter:
  n/a

Standards-Positions Discussion:

web-platform-tests:

This is a proposal I've been advancing in TC39 and WHATWG since last November, and I'm now working on its implementation.
Reply all
Reply to author
Forward
0 new messages