Expand description
Vue/Svelte Single File Component (SFC) script and style extraction.
Extracts <script> block content from .vue and .svelte files using regex,
handling lang, src metadata, and generic attributes, and filtering
HTML comments. Vue external script references are emitted as graph edges;
Svelte markup-level script src references are treated as runtime HTML.
Also extracts <style> block sources (@import / @use / @forward /
@plugin and <style src="...">) so referenced CSS / SCSS files become
reachable from the component, preventing false unused-files reports on
co-located styles.
Structs§
- SfcScript
- An extracted
<script>block from a Vue or Svelte SFC. - SfcStyle
- An extracted
<style>block from a Vue or Svelte SFC. - Source
Region - A source region extracted from a larger file while preserving the byte offset of the region body in the original source.
Functions§
- extract_
sfc_ scripts - Extract all
<script>blocks from a Vue/Svelte SFC source string. - extract_
sfc_ styles - Extract all
<style>blocks from a Vue/Svelte SFC source string. - extract_
sfc_ template_ regions - Extract template markup regions from a Vue/Svelte SFC.
- is_
sfc_ file - Check if a file path is a Vue or Svelte SFC (
.vueor.svelte).