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, and generic attributes, and filtering HTML comments.
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.
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. - is_
sfc_ file - Check if a file path is a Vue or Svelte SFC (
.vueor.svelte).