--- title: Use Single-File Components with Build Tools impact: MEDIUM impactDescription: SFCs provide better DX, scoped styles, and tooling support for Vue applications type: efficiency tags: [vue3, sfc, single-file-components, build-tools, vite] --- # Use Single-File Components with Build Tools **Impact: MEDIUM** - Single-File Components (SFCs) are the recommended way to author Vue components when using a build setup. They provide better organization, scoped styles, and superior tooling support. SFCs (`.vue` files) encapsulate template, logic, and styles in a single file. While Vue can work without build tools, SFCs unlock the full power of the framework including ` ``` ## SFC Benefits | Feature | Without SFC | With SFC | |---------|-------------|----------| | Template syntax highlighting | No | Yes | | Scoped CSS | Manual (CSS Modules) | Built-in | | TypeScript support | Basic | Full with Volar | | Hot Module Replacement | Limited | Full support | | Build-time optimizations | None | Template compilation | | IDE autocompletion | Limited | Full support | ## When NOT to Use SFCs ```html
``` ## Reference - [Vue.js Introduction - Single-File Components](https://vuejs.org/guide/introduction.html#single-file-components) - [SFC Syntax Specification](https://vuejs.org/api/sfc-spec.html)