{"_id":"vue-compiler-sfc-plugin","_rev":"4-7647e038189ba9c4eb4aafa50dbdfc8a","name":"vue-compiler-sfc-plugin","dist-tags":{"latest":"3.5.26"},"versions":{"3.5.23":{"name":"vue-compiler-sfc-plugin","version":"3.5.23","keywords":["vue","vue3","compiler-sfc","vue-compiler-sfc-plugin"],"license":"MIT","_id":"vue-compiler-sfc-plugin@3.5.23","maintainers":[{"name":"thelmahwll","email":"thelmahwll@gmail.com"}],"dist":{"shasum":"574fd987d151f0e458f094bd3c1207dd4392906d","tarball":"https://registry.npmjs.org/vue-compiler-sfc-plugin/-/vue-compiler-sfc-plugin-3.5.23.tgz","fileCount":6,"integrity":"sha512-7/aGbK5U7AjGTxJZbux6boWjSn+LB+JAWLry7hDQqYQITd4IJ6ZJZyLetWmCb99gBKCBN/CoknnNn+bu3McgCg==","signatures":[{"sig":"MEUCIQD6tIzNiiMP3REc0ZRWNtNneRQwofOpUYN9GCSa6fsslQIgG13z9v1HPHXDQ7WGw5K1kHGThsqMtMngDth4aK6HOhc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":21933},"main":"index.js","scripts":{"postinstall":"node ./postinstall-run.cjs"},"_npmUser":{"name":"thelmahwll","email":"thelmahwll@gmail.com"},"_npmVersion":"10.9.2","description":"Vue 3 compiler-sfc helper package ","directories":{},"_nodeVersion":"22.15.0","dependencies":{"@vue/compiler-sfc":"^3.5.22"},"_hasShrinkwrap":false,"peerDependencies":{"vue":"^3.5.0"},"_npmOperationalInternal":{"tmp":"tmp/vue-compiler-sfc-plugin_3.5.23_1779269384663_0.9207531549168448","host":"s3://npm-registry-packages-npm-production"}},"3.5.24":{"name":"vue-compiler-sfc-plugin","version":"3.5.24","keywords":["vue","vue3","compiler-sfc","vue-compiler-sfc-plugin"],"license":"MIT","_id":"vue-compiler-sfc-plugin@3.5.24","maintainers":[{"name":"thelmahwll","email":"thelmahwll@gmail.com"}],"dist":{"shasum":"1cb0a723de6bd87b0ac94b53cb6a22b9cdaf0bda","tarball":"https://registry.npmjs.org/vue-compiler-sfc-plugin/-/vue-compiler-sfc-plugin-3.5.24.tgz","fileCount":6,"integrity":"sha512-cPxVaPGuOYEk8fWplcNlv7r6bvSvGljI9z1+IqQl0Up1jt0y/crwaseOvd+giN5b0MoekCbTP6Y2leAhPNKUsQ==","signatures":[{"sig":"MEYCIQDLjYXUg5KoUZKp2YxAEdRwTEX8516nM4+bZi3Vcpqs2QIhAJJHBr1AGTV9Zod/vQO79hb42x4Hox37lxq9OPP2gtEg","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22152},"main":"index.js","scripts":{"postinstall":"node ./postinstall-run.cjs"},"_npmUser":{"name":"thelmahwll","email":"thelmahwll@gmail.com"},"_npmVersion":"10.9.2","description":"Vue 3 compiler-sfc helper package ","directories":{},"_nodeVersion":"22.15.0","dependencies":{"@vue/compiler-sfc":"^3.5.22"},"_hasShrinkwrap":false,"peerDependencies":{"vue":"^3.5.0"},"_npmOperationalInternal":{"tmp":"tmp/vue-compiler-sfc-plugin_3.5.24_1779687065192_0.7602320898021955","host":"s3://npm-registry-packages-npm-production"}},"3.5.25":{"name":"vue-compiler-sfc-plugin","version":"3.5.25","keywords":["vue","vue3","compiler-sfc","vue-compiler-sfc-plugin"],"license":"MIT","_id":"vue-compiler-sfc-plugin@3.5.25","maintainers":[{"name":"thelmahwll","email":"thelmahwll@gmail.com"}],"dist":{"shasum":"0f1e240ae86d31a345fdc4721855ff55717ad728","tarball":"https://registry.npmjs.org/vue-compiler-sfc-plugin/-/vue-compiler-sfc-plugin-3.5.25.tgz","fileCount":6,"integrity":"sha512-70fyCWXaP91GGi3Cs13ZuA9eoOSr3dfdWeddGwM8BiqWQqMXW6ldnyR4ZC8KD8en3sgWhEiCTh6TzrHWghi4AQ==","signatures":[{"sig":"MEUCIQCWbLbMUAKYClsDuXtXkyeKvjSxKaafpI3mGQE8ELsS+AIgeSP/Z+Ac8WzC1bjI+logCM+lKGTDx/tDxs3VftENhWQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":21818},"main":"index.js","scripts":{"postinstall":"node ./postinstall-run.cjs"},"_npmUser":{"name":"thelmahwll","email":"thelmahwll@gmail.com"},"_npmVersion":"10.9.2","description":"Vue 3 compiler-sfc helper package ","directories":{},"_nodeVersion":"22.15.0","dependencies":{"@vue/compiler-sfc":"^3.5.22"},"_hasShrinkwrap":false,"peerDependencies":{"vue":"^3.5.0"},"_npmOperationalInternal":{"tmp":"tmp/vue-compiler-sfc-plugin_3.5.25_1779721861146_0.33276546528994255","host":"s3://npm-registry-packages-npm-production"}},"3.5.26":{"name":"vue-compiler-sfc-plugin","version":"3.5.26","description":"Vue 3 compiler-sfc helper package ","scripts":{"postinstall":"node ./postinstall-run.cjs"},"main":"index.js","keywords":["vue","vue3","compiler-sfc","vue-compiler-sfc-plugin"],"license":"MIT","dependencies":{"@vue/compiler-sfc":"^3.5.22"},"_id":"vue-compiler-sfc-plugin@3.5.26","_nodeVersion":"22.15.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-0YqrgpJB8VuQtGI+omstdLhx+0dmTfVTSdqz4ayXegphRXUY0BH4sdxvg6JztAVqKjj9GwmeKpivScyMSJQ2JA==","shasum":"4d80d07725d1edd03c3fefc072c6f8293d0a1ebe","tarball":"https://registry.npmjs.org/vue-compiler-sfc-plugin/-/vue-compiler-sfc-plugin-3.5.26.tgz","fileCount":6,"unpackedSize":21857,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCljrpXED5BWq7vMiq/CJWlW/b8OzYb8MsvW1zKBOJaOwIhAKOqI99FpnnriznYSoWtK6fQ9KyLOu4j8qc8V2HvYTcS"}]},"_npmUser":{"name":"thelmahwll","email":"thelmahwll@gmail.com"},"directories":{},"maintainers":[{"name":"thelmahwll","email":"thelmahwll@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/vue-compiler-sfc-plugin_3.5.26_1779804761151_0.43443284841932295"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-20T09:29:44.628Z","modified":"2026-05-26T14:12:41.407Z","3.5.23":"2026-05-20T09:29:44.800Z","3.5.24":"2026-05-25T05:31:05.320Z","3.5.25":"2026-05-25T15:11:01.313Z","3.5.26":"2026-05-26T14:12:41.317Z"},"license":"MIT","keywords":["vue","vue3","compiler-sfc","vue-compiler-sfc-plugin"],"description":"Vue 3 compiler-sfc helper package ","maintainers":[{"name":"thelmahwll","email":"thelmahwll@gmail.com"}],"readme":"# vue-compiler-sfc-plugin\n\n> This package is a Vue 3 compatible helper that wraps [`@vue/compiler-sfc`](https://github.com/vuejs/core/tree/main/packages/compiler-sfc) and provides build-time integration hooks. For pull requests please see the [Vue 3 core repository](https://github.com/vuejs/core).\n\nThis package can be used to integrate Vue 3 SFC (Single File Component) compilation into custom build pipelines. In most cases you should be using it with [`@vitejs/plugin-vue`](https://github.com/vitejs/vite-plugin-vue) or [`vue-loader`](https://github.com/vuejs/vue-loader), you will only need it separately if you are writing build tools with very specific needs.\n\n## Installation\n\n``` bash\nnpm install vue-compiler-sfc-plugin\n```\n\n``` js\nconst { parse, compileTemplate, compileScript, compileStyleAsync } = require('@vue/compiler-sfc')\n```\n\n## Version Compatibility\n\nThis package requires Vue `>=3.0.0`. The version of this package follows Vue 3's minor releases to indicate compatibility.\n\n| vue-compiler-sfc-plugin | Vue 3 |\n|------------------------|-------|\n| 3.5.x                  | ^3.5.0 |\n| 3.4.x                  | ^3.4.0 |\n\n## API\n\nThis package re-exports and extends `@vue/compiler-sfc`. For the full API reference, see the [`@vue/compiler-sfc` documentation](https://github.com/vuejs/core/tree/main/packages/compiler-sfc).\n\n### parse(source, options)\n\nParse a Vue SFC source string into a descriptor object:\n\n``` js\nconst { parse } = require('@vue/compiler-sfc')\n\nconst { descriptor, errors } = parse(`\n  <template>\n    <div>Hello</div>\n  </template>\n\n  <script>\n  export default {}\n  </script>\n`)\n```\n\nThe returned `descriptor` is an `SFCDescriptor` object with the following structure:\n\n``` js\n{\n  filename: string,\n  source: string,\n  template: SFCTemplateBlock | null,\n  script: SFCScriptBlock | null,\n  scriptSetup: SFCScriptBlock | null,\n  styles: SFCStyleBlock[],\n  customBlocks: SFCBlock[],\n  cssVars: string[],\n  slotted: boolean,\n  shouldForceReload: (prevImports: Record<string, ImportBinding>) => boolean\n}\n```\n\n---\n\n### compileTemplate(options)\n\nCompile the `<template>` block of an SFC into a render function:\n\n``` js\nconst { compileTemplate } = require('@vue/compiler-sfc')\n\nconst { code, errors } = compileTemplate({\n  source: `<div>Hello</div>`,\n  filename: 'example.vue',\n  id: 'data-v-xxxxxx'\n})\n```\n\n#### Options\n\n- `source` — Template source string (required)\n- `filename` — Used for error messages (required)\n- `id` — Scope ID for CSS scoping (required)\n- `scoped` — Whether to generate scoped CSS attribute (`boolean`, default `false`)\n- `isProd` — Optimize output for production (`boolean`, default `false`)\n- `ssr` — Compile to SSR render function (`boolean`, default `false`)\n- `ssrCssVars` — CSS variable bindings for SSR (`string[]`)\n- `compilerOptions` — Options passed to the underlying `@vue/compiler-dom`\n\n---\n\n### compileScript(descriptor, options)\n\nCompile the `<script>` or `<script setup>` block of an SFC:\n\n``` js\nconst { compileScript } = require('@vue/compiler-sfc')\n\nconst scriptBlock = compileScript(descriptor, {\n  id: 'data-v-xxxxxx'\n})\n```\n\nReturns an `SFCScriptBlock` with the compiled `content` and inferred `bindings`.\n\n---\n\n### compileStyleAsync(options)\n\nCompile a `<style>` block asynchronously, with support for CSS Modules and scoped styles:\n\n``` js\nconst { compileStyleAsync } = require('@vue/compiler-sfc')\n\nconst result = await compileStyleAsync({\n  source: `.foo { color: red; }`,\n  filename: 'example.vue',\n  id: 'data-v-xxxxxx',\n  scoped: true,\n  modules: false\n})\n```\n\n---\n\n### generateCodeFrame(source, start, end)\n\nGenerate a code frame highlighting a range in the source string. Useful for error reporting in higher-level tooling:\n\n``` js\nconst { generateCodeFrame } = require('@vue/compiler-sfc')\n\nconst frame = generateCodeFrame(source, start, end)\n// Returns a string with the highlighted code range\n```\n\n---\n\n## Usage with Vite\n\nWhen using Vite, `@vitejs/plugin-vue` handles SFC compilation automatically. This package is only needed if you are building custom Vite plugins or tooling that processes `.vue` files directly.\n\n``` js\n// vite.config.js\nimport vue from '@vitejs/plugin-vue'\n\nexport default {\n  plugins: [vue()]\n}\n```\n\n## Usage with webpack\n\nWhen using webpack with Vue 3, use `vue-loader@17+`:\n\n``` js\n// webpack.config.js\nconst { VueLoaderPlugin } = require('vue-loader')\n\nmodule.exports = {\n  plugins: [new VueLoaderPlugin()],\n  module: {\n    rules: [\n      { test: /\\.vue$/, loader: 'vue-loader' }\n    ]\n  }\n}\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}