fix(tia): parse SFC entries when building the JS module graph (#1919)

* fix(tia): parse SFC entries when building the JS module graph

rolldown has no SFC handling, so every .vue/.svelte page failed to parse at the
first byte of <script> and the JS graph came back empty. Reduce the component to
its script blocks before rolldown sees it, which is enough for import specifiers.

Closes #1918

* fix(tia): keep template-only TS imports and stub CSS as JS

TypeScript elision dropped imports used only in a <template>, so lang="ts" pages lost those edges. Newer rolldown also rejects asset stubs without an explicit moduleType, failing the build on any CSS import.

* fix(tia): ignore comments when detecting default export

* Refresh SFC module graph regression snapshots

---------

Co-authored-by: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com>
This commit is contained in:
atymic
2026-11-17 04:35:31 +11:00
committed by GitHub
parent 2d9dcd750a
commit 433b9893d4
4 changed files with 385 additions and 12 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ test('parallel', function () use ($run): void {
$output = implode("\n", array_slice(explode("\n", (string) $output), -10));
$profileOutput = $run('tests/Fixtures/Suites/SuccessOnly.php', '--profile');
$expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 29 skipped, 1675 passed (3682 assertions)';
$expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 30 skipped, 1727 passed (3739 assertions)';
expect($output)
->toContain("Tests: {$expected}")