If you run Pest on a Laravel application with a Vue or Svelte frontend, this release fixes a hole in the test impact analysis pipeline: the helper that builds the JavaScript dependency graph could never actually parse single-file components. On Vue projects the graph came back silently empty — or the run failed outright when the bundler was available — which meant that changes under resources/js/** never selected a single test. With this fix, .vue and .svelte files are understood by the graph builder, so component changes finally map to the tests that cover them.
What was broken
The helper, bin/pest-tia-vite-deps.mjs, lists .vue and .svelte in both PAGE_EXTENSIONS and resolve.extensions, so those files were collected as entries and handed to rolldown. Rolldown has no single-file-component handling, so every one of them failed to parse at the first byte of <script>. Depending on your install, you got one of two broken outcomes:
- On a normal install,
loadRolldown()returnsnull, so the script wrote a two-byte{}and exited0. The graph was empty, and noresources/js/**change ever selected a test — with nothing warning you. - If rolldown was resolvable, the parse error was reached instead and the run exited
1.
In other words, on a Vue project the two available states were "empty graph" or "failed run".
How the fix works
Since the graph only consumes import specifiers, the fix reduces each component to its <script> blocks before rolldown sees it. The extraction lives in an exported extractSfcScript() function alongside stripJsonComments() and loadAliasFromViteConfig(), so it is directly testable. A few details make it robust:
- The
langattribute is preserved asmoduleType, so alang="ts"block is parsed as TypeScript rather than failing on type syntax. Quoted and unquoted attributes both work. - A synthetic
export default {}is appended when the block has none.<script setup>compiles to a default export but carries no literal one, and importers resolve against it — without this the build fails withMISSING_EXPORTfor every component import. - A mention of
export defaultinside a comment or string is not mistaken for a real one. - Both
<script>and<script setup>blocks in one file are concatenated. - Asset stubs now declare an explicit
moduleType: 'js', because rolldown rejects type-less stubs for CSS as unsupported modules. - The TypeScript transform keeps value imports that only a template uses (
onlyRemoveTypeImports: true), so an edge to a component rendered in<template>is not elided away.
No new dependency and no framework plugin are involved. Given a page like this:
<!-- resources/js/pages/Dashboard.vue -->
<script setup lang="ts">
import { format } from '@/utils/format'
import AppLayout from '@/layouts/AppLayout.vue'
</script>
<template>
<AppLayout>{{ format(total) }}</AppLayout>
</template>
the helper now feeds rolldown essentially just the script:
import { format } from '@/utils/format'
import AppLayout from '@/layouts/AppLayout.vue'
export default {}
and the resulting graph records resources/js/layouts/AppLayout.vue and resources/js/utils/format.ts as dependencies of resources/js/pages/Dashboard.vue.
What you'll see after upgrading
The fix was verified against a Vue application with roughly 150 pages:
| before | after | |
|---|---|---|
| output | {} (2 bytes) |
312 KB |
| files mapped | 0 | 753 |
| edges | 0 | 11,838 |
| exit | 0 | 0 |
The graph builds in about 121 ms. Spot checks resolve as expected: a shared layout maps to every page that imports it, a shared utility module maps to its importers, and each page's direct dependencies match its real imports. In practice, editing AppLayout.vue will now select the tests covering every page that renders it — previously that connection simply did not exist.
Upgrade impact
There is nothing to configure and nothing to opt into: the change is entirely inside the shipped helper script, so upgrading replaces the broken behaviour with a working graph on the first run. If your project previously wrote {} or exited 1 when the helper ran, you will now get a real module map instead. New unit tests cover the component shapes you are likely to ship — <script setup>, plain <script> with an existing default, lang="ts" and lang="tsx", both blocks in one file, template-only components, style blocks, dynamic imports, Svelte, and files with no script at all — plus an end-to-end bundle test that runs when rolldown is resolvable and skips otherwise.
One honest caveat: the Svelte extraction is pinned by fixtures, but it could not be validated against a full real-world Svelte project. .svelte is included because the page extension list already contained it.
Takeaways
- Vue and Svelte single-file components now participate in the TIA JavaScript module graph instead of failing to parse or being silently dropped.
- The silent empty-graph state is gone: on a real Vue app, 753 files and 11,838 edges are now mapped where zero were before.
- No configuration, new dependencies, or framework plugins are required — upgrade and rebuild the graph as usual.
lang="ts"scripts,<script setup>, multi-block components, and template-only components are all handled, with TypeScript kept as TypeScript.