Tobias Koppers
3ae062a107
fix(turbopack): support type: 'text' in rules, and error on binding imports of non-ESM modules ( #96558 )
...
`TurbopackModuleType` has listed `'text'` for a while, but the config
schema
and `ConfiguredModuleType::parse` both rejected it. It now maps to the
existing
`TextSourceTransform` (the same thing `import … with { type: 'text' }`
uses).
`'json'`, which Rust already accepted, is added to the TypeScript type
and
schema too.
`type: 'raw'` has always been documented as "Return raw contents as
string",
but it mapped to an opaque module with no exports instead — that
mismatch is
why `import * as ns from './alpha.md'` with `{ '*.md': { type: 'raw' }
}`
evaluated to `undefined`. `raw` is now an alias of `text`: both run the
file
through `TextSourceTransform` and export its contents as a string.
Neither
name is deprecated; `text` remains the descriptive spelling that matches
the
`import … with { type: 'text' }` import attribute, `raw` keeps working
exactly
as documented. No configuration value maps to the opaque module type
anymore;
`type: 'asset'` remains the way to emit a file and get its URL.
This is also what makes Vite's `?raw` workable: Turbopack has no
built-in
`?raw` handling, so a `{ condition: { query: '?raw' }, type: 'text' }`
(or
`'raw'`) rule is what turns those files into strings. Docs previously
implied
`?raw`/`?url` worked standalone; that's corrected, and the module type
table
is completed and describes `raw`/`text` as equivalent.
Reading a binding off a module that genuinely can't be placed in an
ECMAScript chunk (a stylesheet, a native addon, …) used to evaluate to
`undefined` with no diagnostic; it now reports an error naming the
module.
Side-effect-only imports still work.
<!-- NEXT_JS_LLM -->
---------
Co-authored-by: vercel-fleet[bot] <308483924+vercel-fleet[bot]@users.noreply.github.com>
Co-authored-by: Tobias Koppers <1365881+sokra@users.noreply.github.com >
2026-08-07 11:38:59 +02:00
..
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-12 13:16:31 +02:00
2026-07-24 12:00:49 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-08-07 11:38:59 +02:00
2026-07-23 23:25:55 +02:00
2026-04-14 16:45:23 -07:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-22 14:01:58 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-12 13:16:31 +02:00
2026-05-12 13:16:31 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-08-06 09:53:09 +00:00
2026-05-12 13:16:31 +02:00
2026-05-11 13:55:47 +02:00
2026-07-01 15:51:33 +00:00
2026-05-22 14:01:58 +02:00
2026-05-22 14:01:58 +02:00
2026-06-03 12:23:36 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-06-03 12:23:36 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-07-10 12:11:26 -07:00
2026-05-11 13:55:47 +02:00
2026-05-12 13:16:31 +02:00
2026-05-12 13:16:31 +02:00
2026-05-12 13:16:31 +02:00
2026-05-12 13:16:31 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-04-30 10:01:06 +02:00
2026-06-15 23:19:53 +00:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-06-12 21:28:39 +00:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-22 14:01:58 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-08-02 11:33:33 -07:00
2026-06-03 12:23:36 +02:00
2026-05-11 13:55:47 +02:00
2026-07-13 09:56:16 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-12 13:16:31 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-07-13 14:52:27 +00:00
2026-05-26 16:50:38 +02:00
2026-05-22 14:01:58 +02:00
2026-05-22 14:01:58 +02:00
2026-05-12 13:16:31 +02:00
2026-07-24 12:00:49 +02:00
2026-05-22 14:01:58 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-22 14:01:58 +02:00
2026-07-28 14:05:06 -04:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-07-10 12:11:26 -07:00
2026-07-28 17:34:04 +00:00
2026-06-15 23:19:53 +00:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-06-19 14:13:33 -04:00
2026-07-07 14:02:02 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-07-28 11:51:29 -04:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-22 14:01:58 +02:00
2026-05-22 14:01:58 +02:00
2026-05-22 14:01:58 +02:00
2026-05-11 13:55:47 +02:00
2026-05-22 14:01:58 +02:00
2026-05-22 14:01:58 +02:00
2026-05-22 14:01:58 +02:00
2026-05-22 14:01:58 +02:00
2026-05-13 14:50:03 +02:00
2026-05-12 13:16:31 +02:00
2026-05-12 13:16:31 +02:00
2026-05-22 14:01:58 +02:00
2026-07-21 18:46:47 +02:00
2026-05-22 14:01:58 +02:00
2026-05-12 13:16:31 +02:00
2026-05-12 13:16:31 +02:00
2026-07-13 06:36:36 +00:00
2026-05-22 14:01:58 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-15 15:16:42 +00:00
2026-05-22 14:01:58 +02:00
2026-05-11 13:55:47 +02:00
2026-06-04 13:14:34 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-07-27 10:25:54 -04:00
2026-05-22 14:01:58 +02:00
2026-05-22 14:01:58 +02:00
2026-05-22 14:01:58 +02:00
2026-07-21 19:52:09 +00:00
2026-07-21 19:52:09 +00:00
2026-05-22 14:01:58 +02:00
2026-05-22 14:01:58 +02:00
2026-07-21 17:25:13 +00:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-22 14:01:58 +02:00
2026-07-13 09:56:16 +02:00
2026-05-11 13:55:47 +02:00
2026-08-05 15:13:24 +00:00
2026-07-06 14:53:45 +02:00
2026-05-11 13:55:47 +02:00
2026-05-22 14:01:58 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-07-10 15:55:29 +02:00
2026-05-12 13:16:31 +02:00
2026-06-15 15:31:02 -07:00
2026-05-11 21:31:40 +02:00
2026-06-30 01:27:24 +00:00
2026-06-30 01:27:24 +00:00
2026-05-22 14:01:58 +02:00
2026-05-22 14:01:58 +02:00
2026-05-18 09:51:36 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-07-21 18:46:45 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-07-09 16:26:18 -07:00
2026-05-22 14:01:58 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-12 13:16:31 +02:00
2026-05-11 13:55:47 +02:00
2026-05-18 09:51:36 +02:00
2026-06-16 21:29:37 +02:00
2026-04-15 14:55:20 +02:00
2026-05-12 13:16:31 +02:00
2026-05-22 14:01:58 +02:00
2026-06-15 23:19:53 +00:00
2026-05-22 14:01:58 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-12 13:16:31 +02:00
2026-05-22 14:01:58 +02:00
2026-06-16 21:29:37 +02:00
2026-07-08 18:02:21 +02:00
2026-06-09 17:08:03 +00:00
2026-08-05 07:41:54 +02:00
2026-05-22 14:01:58 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-05-12 13:16:31 +02:00
2026-06-15 23:19:53 +00:00
2026-08-06 09:53:09 +00:00
2026-05-11 13:55:47 +02:00
2026-05-11 13:55:47 +02:00
2026-07-21 14:54:01 -07:00
2026-05-12 13:16:31 +02:00
2026-05-22 14:01:58 +02:00
2026-07-24 12:00:49 +02:00