{"_id":"@aurelia/sfc-vite","_rev":"3-87f51ea9da21fe9c1497865bc73fcd71","name":"@aurelia/sfc-vite","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@aurelia/sfc-vite","version":"0.0.1","keywords":["aurelia","vite","plugin","sfc","single file components"],"author":{"name":"Dwayne Charrington"},"license":"MIT","_id":"@aurelia/sfc-vite@0.0.1","maintainers":[{"name":"aureliaeffect","email":"dwaynecharrington+aurelia@gmail.com"}],"homepage":"https://github.com/aurelia/sfc-vite#readme","bugs":{"url":"https://github.com/aurelia/sfc-vite/issues"},"dist":{"shasum":"6d4b40554e4adc7ee7da24bce49fd1ce997a3112","tarball":"https://registry.npmjs.org/@aurelia/sfc-vite/-/sfc-vite-0.0.1.tgz","fileCount":7,"integrity":"sha512-iCR8ckxIRzxnplxyo27KlixKu4NuaK5omQ8ulWDxM2NIe6aPjPG0xY1eX1JbOh0+8NUjEFYbjLOWjaCjSizg+A==","signatures":[{"sig":"MEQCIARfaCXibAHyaH3Iiun4i1khGcZSl0i0X0wLiTIZqhbjAiASwWbHEMQpXStqQ8h8ZNJktQEY46UVigEnq4Hat8l93g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":38626},"main":"dist/index.js","type":"module","module":"dist/index.js","gitHead":"21902ff702258d7eed0fbe6baeadae6f3228413f","scripts":{"build":"rollup -c","watch":"rollup -c -w","prepare":"npm run build"},"_npmUser":{"name":"aureliaeffect","email":"dwaynecharrington+aurelia@gmail.com"},"repository":{"url":"git+https://github.com/aurelia/sfc-vite.git","type":"git"},"_npmVersion":"10.9.1","description":"A Vite plugin for Aurelia single file components","directories":{},"_nodeVersion":"22.0.0","dependencies":{"sass":"^1.83.4","stylus":"^0.64.0","typescript":"^5.7.2","node-html-parser":"^7.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^4.34.2","@rollup/plugin-node-resolve":"^16.0.0"},"peerDependencies":{"vite":">=6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/sfc-vite_0.0.1_1738670611850_0.8995272186926073","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@aurelia/sfc-vite","version":"0.0.2","keywords":["aurelia","vite","plugin","sfc","single file components"],"author":{"name":"Dwayne Charrington"},"license":"MIT","_id":"@aurelia/sfc-vite@0.0.2","maintainers":[{"name":"aureliaeffect","email":"dwaynecharrington+aurelia@gmail.com"}],"homepage":"https://github.com/aurelia/sfc-vite#readme","bugs":{"url":"https://github.com/aurelia/sfc-vite/issues"},"dist":{"shasum":"fd4053346fed870f3688af009d7f9b53a26c897b","tarball":"https://registry.npmjs.org/@aurelia/sfc-vite/-/sfc-vite-0.0.2.tgz","fileCount":7,"integrity":"sha512-ENdOeO5nsftRbcpQxkVyKEkqh1RaDwMehN3WE6l18zzWRVuOxs6g9KKeiAtpQUgkIcaFtw1w7RFdggzNfYHCzg==","signatures":[{"sig":"MEUCIGgDIvExU8oM3w+nTAMc/NJRpaCWqfu83zYGS+ED3dPSAiEAwOt25mxBwdCcVND27ViXkvuGKd9NU7h6deektKu7fp4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":38911},"main":"dist/index.js","type":"module","module":"dist/index.js","gitHead":"21902ff702258d7eed0fbe6baeadae6f3228413f","scripts":{"build":"rollup -c","watch":"rollup -c -w","prepare":"npm run build"},"_npmUser":{"name":"aureliaeffect","email":"dwaynecharrington+aurelia@gmail.com"},"repository":{"url":"git+https://github.com/aurelia/sfc-vite.git","type":"git"},"_npmVersion":"10.9.1","description":"A Vite plugin for Aurelia single file components","directories":{},"_nodeVersion":"22.0.0","dependencies":{"sass":"^1.83.4","stylus":"^0.64.0","typescript":"^5.7.2","node-html-parser":"^7.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^4.34.2","@rollup/plugin-node-resolve":"^16.0.0"},"peerDependencies":{"vite":">=6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/sfc-vite_0.0.2_1738671134643_0.8827078795171457","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-02-04T12:03:31.685Z","modified":"2026-05-28T01:50:38.404Z","0.0.1":"2025-02-04T12:03:32.009Z","0.0.2":"2025-02-04T12:12:14.834Z"},"bugs":{"url":"https://github.com/aurelia/sfc-vite/issues"},"author":{"name":"Dwayne Charrington"},"license":"MIT","homepage":"https://github.com/aurelia/sfc-vite#readme","keywords":["aurelia","vite","plugin","sfc","single file components"],"repository":{"url":"git+https://github.com/aurelia/sfc-vite.git","type":"git"},"description":"A Vite plugin for Aurelia single file components","maintainers":[{"email":"dwaynecharrington+aurelia@gmail.com","name":"aureliaeffect"},{"email":"bigopon.777@gmail.com","name":"bigopon"},{"email":"dwaynecharrington@gmail.com","name":"vheissu"}],"readme":"# Aurelia 2 Single File Components Vite Plugin\n\n>Please note this is an experimental plugin and not stable yet.\n\n## Overview\n\nThis Vite plugin adds support for Single File Components (SFCs) in Aurelia 2 applications using the .au format. It allows developers to define `<script>`, `<template>`, and optional `<style>` tags within a single file, which are then processed into valid Aurelia 2 components.\n\n## Features\n\n- Single File Components: Define your component's logic, template, and styles in one `.au` file.\n- Scoped Styles: Supports scoped styles with automatic scoping using unique identifiers.\n- Preprocessor Support: Supports Sass, Stylus, and custom preprocessors.\n- Automatic Component Naming: If a component name is not explicitly set, it is inferred from the class name.\n- Optimized for Vite: Uses virtual modules for fast hot module replacement (HMR) and efficient bundling.\n\n## Installation\n\n```shell\nnpm install @aurelia/sfc-vite --save-dev\n```\n\n## Usage\n\nIn your `vite.config.js` or `vite.config.ts`:\n\n```javascript\nimport { defineConfig } from 'vite';\nimport aurelia from '@aurelia/vite-plugin';\nimport aureliaSingleFileComponent from '@aurelia/sfc-vite';\n\nexport default defineConfig({\n  plugins: [\n    aurelia(),\n    aureliaSingleFileComponent()\n  ]\n});\n```\n\n## Example `.au` File\n\n```\n<script lang=\"ts\">\n  import { bindable } from 'aurelia';\n\n  export default class MyComponent {\n    @bindable name = 'World';\n  }\n</script>\n\n<template>\n  <h1>Hello, ${name}!</h1>\n</template>\n\n<style scoped>\n  h1 {\n    color: blue;\n  }\n</style>\n```\n\n## Scoped Styles\n\nIf a `<style scoped>` tag is used, a unique attribute (e.g., data-v-xxxxx) is automatically applied to the component's root template element, ensuring styles remain encapsulated.\n\n## Style Preprocessors\n\nThe plugin supports preprocessing for:\n\n- Sass/SCSS (lang=\"scss\" or lang=\"sass\")\n- Stylus (lang=\"stylus\")\n- Custom Preprocessors via plugin options\n\nExample:\n\n```\n<style lang=\"scss\" scoped>\n  $primary: red;\n  h1 {\n    color: $primary;\n  }\n</style>\n```\n\n## Plugin Options\n\nYou can customize the plugin with options in vite.config.js:\n\n```\nimport aureliaSingleFileComponent from '@aurelia/sfc-vite';\n\nexport default defineConfig({\n  plugins: [\n    aureliaSingleFileComponent({\n      style: {\n        preprocessors: {\n          scss: (code, options) => require('sass').compileString(code, options).css,\n          stylus: (code, options) => require('stylus').render(code, options)\n        }\n      }\n    })\n  ]\n});\n```\n\n## Limitations\n\n- The `<script>` and `<template>` sections are required.\n- Only one `<script>` and `<template>` block per `.au` file.\n- Limited support for multi-root templates.\n- Basic style scoping (no deep selectors or advanced nesting behavior).\n","readmeFilename":"README.md"}